Examples of writeDefaultNamespace()


Examples of com.envoisolutions.sxc.util.XoXMLStreamWriter.writeDefaultNamespace()

           
            if (jaxbElement != null) {
                QName n = jaxbElement.getName();
                w.writeStartElement("",  n.getLocalPart(), n.getNamespaceURI());
                // TODO: we should check to see if a NS is already written here
                w.writeDefaultNamespace(n.getNamespaceURI());
               
                o = jaxbElement.getValue();
            }
           
            if (o == null) {
View Full Code Here

Examples of com.envoisolutions.sxc.util.XoXMLStreamWriterImpl.writeDefaultNamespace()

           
            if (jaxbElement != null) {
                QName n = jaxbElement.getName();
                w.writeStartElement("",  n.getLocalPart(), n.getNamespaceURI());
                // TODO: we should check to see if a NS is already written here
                w.writeDefaultNamespace(n.getNamespaceURI());
               
                o = jaxbElement.getValue();
            }
           
            if (o == null) {
View Full Code Here

Examples of de.odysseus.staxon.xml.SimpleXMLStreamWriter.writeDefaultNamespace()

    StringWriter result = new StringWriter();
    XMLStreamWriter writer = new SimpleXMLStreamWriter(result, false);
    writer.setDefaultNamespace("http://some-namespace");
    writer.writeStartDocument();
    writer.writeStartElement("alice");
    writer.writeDefaultNamespace("http://some-namespace");
    writer.writeCharacters("bob");
    writer.writeEndElement();
    writer.writeEndDocument();
    writer.close();
    Assert.assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><alice xmlns=\"http://some-namespace\">bob</alice>", result.toString());
View Full Code Here

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

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

        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

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

        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

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

        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

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

        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

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

                    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

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

        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
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.