Package javax.xml.stream

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


        if (useRepairing) {
            out.setPrefix("", CHEESENS);
        }
        out.writeStartElement("", "cheddar", CHEESENS);
        if (!useRepairing) {
            out.writeDefaultNamespace(CHEESENS);
        }
        out.writeEndElement();
        out.writeEndElement();
        out.writeEndElement();
        out.writeEndDocument();
View Full Code Here


        xmlSecurityStreamWriter.writeStartElement("test1");
        stdXmlStreamWriter.writeStartElement("test1");

        xmlSecurityStreamWriter.writeDefaultNamespace("defaultns");
        stdXmlStreamWriter.writeDefaultNamespace("defaultns");

        xmlSecurityStreamWriter.writeNamespace("t2new", "test2ns");
        stdXmlStreamWriter.writeNamespace("t2new", "test2ns");

        xmlSecurityStreamWriter.writeStartElement("test2ns", "test2");
View Full Code Here

        try {
            XMLStreamWriter xmlStreamWriter =
                    StAXUtils.createXMLStreamWriter(System.out);

            xmlStreamWriter.writeStartElement("Foo");
            xmlStreamWriter.writeDefaultNamespace("test.org");
            xmlStreamWriter.setDefaultNamespace("test.org");
            xmlStreamWriter.writeStartElement("Bar");

            xmlStreamWriter.writeEndElement();
            xmlStreamWriter.writeEndElement();
View Full Code Here

        assertEquals("", writer.getPrefix("http://default"));
        assertEquals("ns1", writer.getPrefix("http://ns1"));
        assertEquals("ns2", writer.getPrefix("http://ns2"));
       
        writer.writeStartElement("foo");
        writer.writeDefaultNamespace("http://default");
        writer.writeNamespace("ns1", "http://ns1");
        writer.writeNamespace("ns2", "http://ns2");
       
       
        writer.setDefaultNamespace("http://default-new");
View Full Code Here

        assertEquals("ns2", writer.getPrefix("http://ns2-new"));
        assertEquals("ns3", writer.getPrefix("http://ns3"));
        assertEquals("ns4", writer.getPrefix("http://ns4"));
       
        writer.writeStartElement("bar");
        writer.writeDefaultNamespace("http://default-new");
        writer.writeNamespace("ns2", "http://ns2-new");
        writer.writeNamespace("ns3", "http://ns3");
        writer.writeNamespace("ns4", "http://ns4");
                       
        writer.writeEndElement(); // bar
View Full Code Here

                    pfx = StaxUtils.getUniquePrefix(xmlWriter, name.getNamespaceURI(), false);
                }
                xmlWriter.setPrefix(pfx, name.getNamespaceURI());
                xmlWriter.writeStartElement(pfx, name.getLocalPart(), name.getNamespaceURI());
                if (StringUtils.isEmpty(pfx)) {
                    xmlWriter.writeDefaultNamespace(name.getNamespaceURI());
                } else {
                    xmlWriter.writeNamespace(pfx, name.getNamespaceURI());
                }
            } catch (XMLStreamException e) {
                throw new Fault(new org.apache.cxf.common.i18n.Message("STAX_WRITE_EXC", BUNDLE), e);
View Full Code Here

        XMLStreamWriter streamWriter = StaxUtils.getXMLStreamWriter(payload.getResult());

        String namespace = "http://springframework.org/spring-ws";
        streamWriter.setDefaultNamespace(namespace);
        streamWriter.writeStartElement(namespace, "root");
        streamWriter.writeDefaultNamespace(namespace);
        streamWriter.writeStartElement(namespace, "child");
        streamWriter.writeCharacters("text");
        streamWriter.writeEndElement();
        streamWriter.writeEndElement();
        streamWriter.flush();
View Full Code Here

        XMLStreamWriter streamWriter = StaxUtils.getXMLStreamWriter(payload.getResult());

        String namespace = "http://springframework.org/spring-ws";
        streamWriter.setDefaultNamespace(namespace);
        streamWriter.writeStartElement(namespace, "root");
        streamWriter.writeDefaultNamespace(namespace);
        streamWriter.writeStartElement(namespace, "child");
        streamWriter.writeCharacters("text");
        streamWriter.writeEndDocument();
        streamWriter.flush();
View Full Code Here

        XMLStreamWriter streamWriter = StaxUtils.getXMLStreamWriter(payload.getResult());

        String namespace = "http://springframework.org/spring-ws";
        streamWriter.setDefaultNamespace(namespace);
        streamWriter.writeStartElement(namespace, "root");
        streamWriter.writeDefaultNamespace(namespace);
        streamWriter.writeEmptyElement(namespace, "child");
        streamWriter.writeEndElement();
        streamWriter.flush();

        StringWriter writer = new StringWriter();
View Full Code Here

                    pfx = StaxUtils.getUniquePrefix(xmlWriter, name.getNamespaceURI(), false);
                }
                xmlWriter.setPrefix(pfx, name.getNamespaceURI());
                xmlWriter.writeStartElement(pfx, name.getLocalPart(), name.getNamespaceURI());
                if (StringUtils.isEmpty(pfx)) {
                    xmlWriter.writeDefaultNamespace(name.getNamespaceURI());
                } else {
                    xmlWriter.writeNamespace(pfx, name.getNamespaceURI());
                }
            } catch (XMLStreamException e) {
                throw new Fault(new org.apache.cxf.common.i18n.Message("STAX_WRITE_EXC", BUNDLE), e);
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.