Examples of normalizeDocument()


Examples of org.w3c.dom.Document.normalizeDocument()

    }

    reset();

    Document root = documentBuilder.parse(new InputSource(reader));
    root.normalizeDocument(); // TODO set as feature instead?
    return root;
  }

  /**
   * Create document from an {@link InputStream}.
View Full Code Here

Examples of org.w3c.dom.Document.normalizeDocument()

    }

    reset();

    Document root = documentBuilder.parse(in);
    root.normalizeDocument(); // TODO set as feature instead?
    return root;
  }

  /**
   *
 
View Full Code Here

Examples of org.w3c.dom.Document.normalizeDocument()

        document.appendChild(element);
        DOMConfiguration domConfig = document.getDomConfig();
        domConfig.setParameter("split-cdata-sections", Boolean.FALSE);
        domConfig.setParameter("well-formed", Boolean.FALSE);
        domConfig.setParameter("namespaces", Boolean.TRUE);
        document.normalizeDocument();
        NamedNodeMap attributes = element.getAttributes();
        assertEquals(1, attributes.getLength());
        Attr attr = (Attr)attributes.item(0);
        assertNull(attr.getPrefix());
        assertEquals(XMLConstants.XMLNS_ATTRIBUTE, attr.getLocalName());
View Full Code Here

Examples of org.w3c.dom.Document.normalizeDocument()

        dbf.setIgnoringElementContentWhitespace(true);
        dbf.setIgnoringComments(true);
        DocumentBuilder db = dbf.newDocumentBuilder();

        Document doc1 = db.parse(new ByteArrayInputStream(element1.getBytes("UTF-8")));
        doc1.normalizeDocument();

        Document doc2 = db.parse(new ByteArrayInputStream(element1.getBytes("UTF-8")));
        doc2.normalizeDocument();

        return doc1.isEqualNode(doc2);
View Full Code Here

Examples of org.w3c.dom.Document.normalizeDocument()

        Document doc1 = db.parse(new ByteArrayInputStream(element1.getBytes("UTF-8")));
        doc1.normalizeDocument();

        Document doc2 = db.parse(new ByteArrayInputStream(element1.getBytes("UTF-8")));
        doc2.normalizeDocument();

        return doc1.isEqualNode(doc2);
    }

}
View Full Code Here

Examples of org.w3c.dom.Document.normalizeDocument()

                // the message are required.
                DOMConfiguration domConfig = document.getDomConfig();
                domConfig.setParameter("split-cdata-sections", Boolean.FALSE);
                domConfig.setParameter("well-formed", Boolean.FALSE);
                domConfig.setParameter("namespaces", Boolean.TRUE);
                document.normalizeDocument();
                return document;
            }
           
            if (useDoom) {
                env.build();
View Full Code Here

Examples of org.w3c.dom.Document.normalizeDocument()

            dbf.setCoalescing(true);
            dbf.setIgnoringElementContentWhitespace(true);
            dbf.setIgnoringComments(true);
            DocumentBuilder db = dbf.newDocumentBuilder();
            Document document = db.parse(new ByteArrayInputStream(xmlContent.getBytes()));
            document.normalizeDocument();
            processNode(document);
            return XmlUtils.serializePretty(document);
        } catch (ParserConfigurationException e) {
            throw new RuntimeException(e);
        } catch (SAXException e) {
View Full Code Here

Examples of org.w3c.dom.Document.normalizeDocument()

     * {@inheritDoc}
     */
    @Override
    public Configuration addChild(Configuration child) {
        Document this_doc = _element.getOwnerDocument();
        this_doc.normalizeDocument();
        DOMConfiguration child_config = new DOMConfiguration(child);
        Document child_doc = child_config._element.getOwnerDocument();
        if (child_doc != this_doc) {
            child_doc.normalizeDocument();
            this_doc.adoptNode(child_config._element);
View Full Code Here

Examples of org.w3c.dom.Document.normalizeDocument()

        Document this_doc = _element.getOwnerDocument();
        this_doc.normalizeDocument();
        DOMConfiguration child_config = new DOMConfiguration(child);
        Document child_doc = child_config._element.getOwnerDocument();
        if (child_doc != this_doc) {
            child_doc.normalizeDocument();
            this_doc.adoptNode(child_config._element);
        }
        _element.appendChild(child_config._element);
        String child_xmlns = Strings.trimToNull(child_config._element.getNamespaceURI());
        if (child_xmlns == null) {
View Full Code Here

Examples of org.w3c.dom.Document.normalizeDocument()

    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    dbf.setNamespaceAware(true);
    DocumentBuilder db = dbf.newDocumentBuilder();
    Document expected = db.parse(out);

    expected.normalizeDocument();
    o.normalizeDocument();
   
    String xpath = "/results/resource[@uri='http://example.org/test1#Joerg']/title";
    assertXpathValuesEqual(xpath, expected, xpath, o);
    xpath = "/results/resource[@uri='http://example.org/test1#Joerg']/property/@uri";
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.