Package org.w3c.dom

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


                DocumentBuilderFactory.newInstance();
        final DocumentBuilder docBuilder =
                docBuilderFactory.newDocumentBuilder();
        final Document doc = docBuilder.parse(jndiConfig);

        doc.normalizeDocument();

        XPathFactory factory = XPathFactory.newInstance();
        XPath xpath = factory.newXPath();
        final Node paramsNode = (Node) xpath.evaluate(
                "//service[@name='"+serviceName+"']/resource[@name='"+resourceName+"']/resourceParams",
View Full Code Here


                DocumentBuilderFactory.newInstance();
        final DocumentBuilder docBuilder =
                docBuilderFactory.newDocumentBuilder();
        final Document doc = docBuilder.parse(new File(serverConfigPath));

        doc.normalizeDocument();

        final NodeList topnodes = doc.getDocumentElement().
                getElementsByTagName("globalConfiguration");

        if (topnodes == null || topnodes.item(0) == null) {
View Full Code Here

        try {
           
            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            InputSource input = new InputSource(new StringReader(xml));
            Document doc = factory.newDocumentBuilder().parse(xml);
            doc.normalizeDocument();
            return doc;
           
        } catch (ParserConfigurationException ex) {
            System.out.println(ex.getMessage());
        } catch (SAXException ex) {
View Full Code Here

        DocumentBuilder db = dbf.newDocumentBuilder();
        Document expected = db.parse(file);
        File f = new File(generated_.getPath() + File.separator
            + file.getName());
        Document generated = db.parse(f);
        generated.normalizeDocument();
        expected.normalizeDocument();

        Diff myDiff = new Diff(expected, generated);
        // Elment and attributes in the xcas could be in different
        // Ordering
View Full Code Here

        dbf.setCoalescing(true);
        dbf.setIgnoringElementContentWhitespace(true);
        dbf.setIgnoringComments(true);
        DocumentBuilder db = dbf.newDocumentBuilder();
        Document doc1 = db.parse(expected.toURI().toString());
        doc1.normalizeDocument();
        InputSource is2 = new InputSource();
        is2.setCharacterStream(new StringReader(output));
        Document doc2 = db.parse(is2);
        doc2.normalizeDocument();
        assertTrue(doc1.isEqualNode(doc2));
View Full Code Here

        Document doc1 = db.parse(expected.toURI().toString());
        doc1.normalizeDocument();
        InputSource is2 = new InputSource();
        is2.setCharacterStream(new StringReader(output));
        Document doc2 = db.parse(is2);
        doc2.normalizeDocument();
        assertTrue(doc1.isEqualNode(doc2));
    }

    /**
     * Get the node path
View Full Code Here

        dbf.setCoalescing(true);
        dbf.setIgnoringElementContentWhitespace(true);
        dbf.setIgnoringComments(true);
        DocumentBuilder db = dbf.newDocumentBuilder();
        Document doc1 = db.parse(expected.toURI().toString());
        doc1.normalizeDocument();
        InputSource is2 = new InputSource();
        is2.setCharacterStream(new StringReader(output));
        Document doc2 = db.parse(is2);
        doc2.normalizeDocument();
        assertTrue(doc1.isEqualNode(doc2));
View Full Code Here

        Document doc1 = db.parse(expected.toURI().toString());
        doc1.normalizeDocument();
        InputSource is2 = new InputSource();
        is2.setCharacterStream(new StringReader(output));
        Document doc2 = db.parse(is2);
        doc2.normalizeDocument();
        assertTrue(doc1.isEqualNode(doc2));
    }

    /**
     * Get the node path
View Full Code Here

    VocabularyElementType elementType = new VocabularyElementType();
    AttributeType at = new AttributeType();
    at.setId("someid");
    DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
    Document document = builder.parse(new ByteArrayInputStream("<mynode>value</mynode>".getBytes("utf-8")));
    document.normalizeDocument();
    at.getAny().add(document.getDocumentElement());

    document = builder.newDocument();
    Element el = document.createElement("myelement");
    el.setTextContent("howdy");
View Full Code Here

    VocabularyElementType elementType = new VocabularyElementType();
    AttributeType at = new AttributeType();
    at.setId("someid");
    DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
    Document document = builder.parse(new ByteArrayInputStream("<mynode>value</mynode>".getBytes("utf-8")));
    document.normalizeDocument();
    at.getAny().add(document.getDocumentElement());

    document = builder.newDocument();
    Element el = document.createElement("myelement");
    el.setTextContent("howdy");
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.