Package javax.xml.parsers

Examples of javax.xml.parsers.DocumentBuilder.newDocument()


            return;
        }

        DocumentBuilderFactory factory = XmlUtil.newDocumentBuilderFactory();
        DocumentBuilder builder = factory.newDocumentBuilder();
        Document doc = builder.newDocument();
        Element root = doc.createElement("metadata");
        doc.appendChild(root);
        createText(doc, root, "groupId", groupId);
        createText(doc, root, "artifactId", artifactId);
        if(artifacts.length > 0) {
View Full Code Here


            // Create an annotation which contains the CORBA binding for the element
            XmlSchemaAnnotation annotation = new XmlSchemaAnnotation();
            XmlSchemaAppInfo appInfo = new XmlSchemaAppInfo();
            try {
                DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
                Document doc = db.newDocument();
                Element el = doc.createElement("appinfo");
                el.setTextContent("corba:binding=" + bindingName.getLocalPart());
                // TODO: This is correct but the appinfo markup is never added to the
                // schema.  Investigate.
                appInfo.setMarkup(el.getChildNodes());
View Full Code Here

        samlParms.setCallbackHandler(new Saml2CallbackHandler());
        AssertionWrapper assertion = new AssertionWrapper(samlParms);
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        dbf.setNamespaceAware(true);
        DocumentBuilder db = dbf.newDocumentBuilder();
        Element assertionElement = assertion.toDOM(db.newDocument());
       
        SecurityToken tok = new SecurityToken(id);
        tok.setTokenType(WSConstants.WSS_SAML2_TOKEN_TYPE);
        tok.setToken(assertionElement);
        store.add(tok);
View Full Code Here

    @Test
    public void testIterationPerformance() throws Exception {
        // create a large document
        final int SIZE = 200000;
        DocumentBuilder db = dbf.newDocumentBuilder();
        test = db.newDocument();
        Element root = test.createElement("root");
        test.appendChild(root);
        for (int i = 0; i < SIZE; i++) {
            Element child = test.createElement("a");
            child.setTextContent(Integer.toString(i));
View Full Code Here

        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        dbf.setNamespaceAware(true);
        dbf.setValidating(false);
        DocumentBuilder db = dbf.newDocumentBuilder();
        Document d = db.newDocument();
        Element root = d.createElement("root");
        XNodeSetForDOM xo = (XNodeSetForDOM) XObjectFactory.create(root, xpathContext);
        Assert.assertEquals(root, xo.object());

    }
View Full Code Here

        try {
            expected = db.parse(in);
        } finally {
            in.close();
        }
        Document actual = db.newDocument();
        // TODO: need to use getSAXSource (instead of toString) because of AXIOM-430
        TransformerFactory.newInstance().newTransformer().transform(soapEnvelope.getSAXSource(true), new DOMResult(actual));
        XMLAssert.assertXMLIdentical(XMLUnit.compareXML(expected, actual), true);
        soapEnvelope.close(false);
    }
View Full Code Here

        super(dbf);
    }

    protected void runTest() throws Throwable {
        DocumentBuilder db = dbf.newDocumentBuilder();
        Document document1 = db.newDocument();
        Document document2 = db.newDocument();
        Element parent = document1.createElementNS(null, "parent");
        Element child1 = document1.createElementNS(null, "child1");
        Element child2 = document1.createElementNS(null, "child2");
        Element child3 = document1.createElementNS(null, "child3");
View Full Code Here

    }

    protected void runTest() throws Throwable {
        DocumentBuilder db = dbf.newDocumentBuilder();
        Document document1 = db.newDocument();
        Document document2 = db.newDocument();
        Element parent = document1.createElementNS(null, "parent");
        Element child1 = document1.createElementNS(null, "child1");
        Element child2 = document1.createElementNS(null, "child2");
        Element child3 = document1.createElementNS(null, "child3");
        parent.appendChild(child1);
View Full Code Here

              if (entityResolver != null)
                docBuilder.setEntityResolver(entityResolver);

              Node xmlDoc = docBuilder.parse(new InputSource(inFileName));
              Document doc = docBuilder.newDocument();
              org.w3c.dom.DocumentFragment outNode =
                doc.createDocumentFragment();

              transformer.transform(new DOMSource(xmlDoc, inFileName),
                                    new DOMResult(outNode));
View Full Code Here

    private void clusterPropertiesToHadoopSiteXml(Properties props, File hadoopSiteXml) throws ParserConfigurationException, TransformerException {
        DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
        DocumentBuilder documentBuilder = domFactory.newDocumentBuilder();

        Document hadoopSiteXmlDoc = documentBuilder.newDocument();

        hadoopSiteXmlDoc.setXmlVersion("1.0");
        hadoopSiteXmlDoc.setXmlStandalone(true);
        hadoopSiteXmlDoc.createProcessingInstruction("xml-stylesheet", "type=\"text/xsl\" href=\"configuration.xsl\"");
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.