Examples of writeStartDocument()


Examples of javax.xml.stream.XMLStreamWriter.writeStartDocument()

        AegisWriter<XMLStreamWriter> aegisWriter = context.createXMLStreamWriter();
        try {
            W3CDOMStreamWriter w3cStreamWriter = new W3CDOMStreamWriter();
            XMLStreamWriter spyingWriter = new PrefixCollectingXMLStreamWriter(w3cStreamWriter,
                                                                               namespaceMap);
            spyingWriter.writeStartDocument();
            // use type qname as element qname?
            aegisWriter.write(obj, aegisType.getSchemaType(), false, spyingWriter, aegisType);
            spyingWriter.writeEndDocument();
            spyingWriter.close();
            Document dom = w3cStreamWriter.getDocument();
View Full Code Here

Examples of javax.xml.stream.XMLStreamWriter.writeStartDocument()

            // ok, now the namespace map has all the prefixes.
           
            String enc = HttpUtils.getSetEncoding(m, headers, "UTF-8");
           
            XMLStreamWriter xmlStreamWriter = createStreamWriter(aegisType.getSchemaType(), enc, os);
            xmlStreamWriter.writeStartDocument();
            StaxUtils.copy(dom, xmlStreamWriter);
            // Jettison needs, and StaxUtils.copy doesn't do it.
            xmlStreamWriter.writeEndDocument();
            xmlStreamWriter.flush();
            xmlStreamWriter.close();
View Full Code Here

Examples of javax.xml.stream.XMLStreamWriter.writeStartDocument()

            // Set up the JSON StAX implementation
            Map<String, String> nstojns = new HashMap<String, String>();
            XMLOutputFactory factory = new MappedXMLOutputFactory(nstojns);
            XMLStreamWriter xsw = factory.createXMLStreamWriter(os);
            xsw.writeStartDocument();
            if (obj != null) {

                XmlObject xObj = obj;
                XMLBeanStreamSerializer ser = new XMLBeanStreamSerializer();
                ser.serialize(xObj, xsw);
View Full Code Here

Examples of javax.xml.stream.XMLStreamWriter.writeStartDocument()

        AegisWriter<XMLStreamWriter> aegisWriter = context.createXMLStreamWriter();
        try {
            String enc = HttpUtils.getSetEncoding(m, headers, "UTF-8");
            XMLStreamWriter xmlStreamWriter = createStreamWriter(aegisType.getSchemaType(), enc, os);
            // use type qname as element qname?
            xmlStreamWriter.writeStartDocument();
            aegisWriter.write(obj, aegisType.getSchemaType(), false, xmlStreamWriter, aegisType);
            xmlStreamWriter.writeEndDocument();
            xmlStreamWriter.close();
        } catch (Exception e) {
            throw ExceptionUtils.toInternalServerErrorException(e, null);
View Full Code Here

Examples of javax.xml.stream.XMLStreamWriter.writeStartDocument()

      OMElement om = (base instanceof Document) ?
        (OMElement)((Document)base).getRoot() :
        (OMElement)base;
      if (om.getParent() != null && om.getParent() instanceof OMDocument) {
        OMDocument doc = (OMDocument) om.getParent();
        pw.writeStartDocument(doc.getCharsetEncoding(), doc.getXMLVersion());
      }
      om.serialize(pw);
      pw.writeEndDocument();
    } catch (XMLStreamException e) {
      throw new RuntimeException(e);
View Full Code Here

Examples of javax.xml.stream.XMLStreamWriter.writeStartDocument()

    }

    protected void runTest() throws Throwable {
        XMLStreamWriter writer = staxImpl.newNormalizedXMLOutputFactory().createXMLStreamWriter(System.out, "UTF-8");
        try {
            writer.writeStartDocument(null, "1.0");
        } catch (Throwable ex) {
            // Expected
            return;
        }
        fail("Expected writeStartDocument to throw an exception");
View Full Code Here

Examples of javax.xml.stream.XMLStreamWriter.writeStartDocument()

    XMLStreamWriter writer = null;
    String objectType = TableConfig.INTERNAL_OBJECTTYPE.valueFrom(table.getTableConfiguration()).toLowerCase();
   
    try {
      writer = outputFactory.createXMLStreamWriter(output);
      writer.writeStartDocument("1.0");
     
      writer.writeStartElement(objectType + "s");

      for (HtmlRow row : table.getBodyRows()) {
        writer.writeStartElement(objectType);
View Full Code Here

Examples of javax.xml.stream.XMLStreamWriter.writeStartDocument()

        Page page = pageManager.getContainingPage(request.getResource());

        XMLOutputFactory outputFactory = XMLOutputFactory.newFactory();
        try {
            XMLStreamWriter stream = outputFactory.createXMLStreamWriter(response.getWriter());
            stream.writeStartDocument("1.0");

            stream.writeStartElement("", "urlset", NS);
            stream.writeNamespace("", NS);

            // first do the current page
View Full Code Here

Examples of javax.xml.stream.XMLStreamWriter.writeStartDocument()

            XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
            XMLStreamWriter xml = outputFactory.createXMLStreamWriter(response.getWriter());

            // Begin document
            xml.writeStartDocument();
            xml.writeStartElement("protocols");

            // Write all protocols
            for (ProtocolInfo protocol : protocols.values())
                writeProtocol(xml, protocol);
View Full Code Here

Examples of javax.xml.stream.XMLStreamWriter.writeStartDocument()

            XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
            XMLStreamWriter xml = outputFactory.createXMLStreamWriter(response.getWriter());

            // Begin document
            xml.writeStartDocument();
            xml.writeStartElement("users");

            // For each entry, write corresponding user element
            for (String username : users) {
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.