Package javax.xml.transform.dom

Examples of javax.xml.transform.dom.DOMResult


    private XMLEventWriter createXMLEventWriter(final Node parent, final Node insertBefore)
        throws XMLStreamException
    {
        XMLOutputFactory f = getOutputFactory();
        return f.createXMLEventWriter(new DOMResult(parent, insertBefore));
    }
View Full Code Here


            System.err.println("Skipping "+getClass().getName()+"#testNonNsOutput: non-namespace-aware mode not supported");
            return;
        }

        Document doc = createDomDoc(false);
        XMLStreamWriter sw = of.createXMLStreamWriter(new DOMResult(doc));

        sw.writeStartDocument();
        sw.writeStartElement("root");
        sw.writeAttribute("attr", "value");
        sw.writeAttribute("ns:attr2", "value2");
View Full Code Here

    public void testNsOutput()
        throws Exception
    {
        Document doc = createDomDoc(false);
        XMLOutputFactory of = getFactory(TYPE_NS);
        XMLStreamWriter sw = of.createXMLStreamWriter(new DOMResult(doc));
        final String NS_URI = "http://foo";

        sw.writeStartDocument();
        sw.writeStartElement("ns", "root", NS_URI);
        sw.writeNamespace("ns", NS_URI);
View Full Code Here

        final String URI1 = "urn:1";
        final String URI2 = "urn:2";

        Document doc = createDomDoc(false);
        XMLOutputFactory of = getFactory(TYPE_NS_REPAIRING);
        XMLStreamWriter sw = of.createXMLStreamWriter(new DOMResult(doc));

        sw.writeStartDocument();
        sw.writeStartElement(URI1, "root");
        sw.writeAttribute("attr", "x");
        sw.writeEmptyElement(URI2, "leaf");
View Full Code Here

        throws Exception
    {
        Document doc = createDomDoc(false);
        // let's use namespace-aware just because some impls might not support non-ns
        XMLOutputFactory of = getFactory(TYPE_NS);
        TypedXMLStreamWriter sw = (TypedXMLStreamWriter) of.createXMLStreamWriter(new DOMResult(doc));

        sw.writeStartDocument();
        sw.writeStartElement("root");
        sw.writeIntAttribute(null, null, "attr", -900);
        sw.writeInt(123);
View Full Code Here

    {
        out.reset();
        XMLOutputFactory outf = getOutputFactory();
  mDoc = createDOMDoc(true);
        setRepairing(outf, repairing);
        return (XMLStreamWriter2) outf.createXMLStreamWriter(new DOMResult(mDoc));
    }
View Full Code Here

    DocumentBuilder docBuilder =
      DocumentBuilderFactory.newInstance().newDocumentBuilder();
    Document doc = docBuilder.newDocument();

    ComplexObj x = new ComplexObj(3);
    trans.serialize(x, new DOMResult(doc));

    ComplexObj y = (ComplexObj) trans.deserialize(new DOMSource(doc));
    assertEquals("wrong deserializer", x, y);
  }
View Full Code Here

   */
  public void testGenerateSchemaToDOM() throws Exception {
    DocumentBuilder docBuilder =
      DocumentBuilderFactory.newInstance().newDocumentBuilder();
    Document doc = docBuilder.newDocument();
    trans.writeXMLSchema(IntObj.class, new DOMResult(doc));
  }
View Full Code Here

            os.close();
          }
        }
      }
      else if (result instanceof DOMResult) {
        DOMResult domResult = (DOMResult) result;

        Node resultNode = domResult.getNode();

        domResult.setNode(transform(node, resultNode));
      }
      else if (result instanceof SAXResult) {
        SAXResult sax = (SAXResult) result;

        transform(node, sax.getHandler(), sax.getLexicalHandler());
View Full Code Here

        result = (Result) _result;
      }
      else if (_var != null) {
        top = new com.caucho.xml.QDocument();
       
        result = new DOMResult(top);
      }
      else {
        result = new StreamResult(new WriterWrapper(out));
      }
View Full Code Here

TOP

Related Classes of javax.xml.transform.dom.DOMResult

Copyright © 2018 www.massapicom. 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.