Package org.apache.tuscany.sca.common.xml.stax.impl

Examples of org.apache.tuscany.sca.common.xml.stax.impl.XMLStreamSerializer


    }

    @Test
    public void testReader() throws Exception {
        XmlTreeStreamReaderImpl reader = new XmlTreeStreamReaderImpl(root);
        XMLStreamSerializer serializer = new XMLStreamSerializer();
        StringWriter sw = new StringWriter();
        XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
        outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE);
        XMLStreamWriter writer = outputFactory.createXMLStreamWriter(sw);
        serializer.serialize(reader, writer);
        String xml = sw.toString();
        XMLAssert.assertXMLEqual(XML_RESULT, xml);
    }
View Full Code Here


    public XMLStreamWriter createXMLStreamWriter(Result result) throws XMLStreamException {
        return outputFactory.createXMLStreamWriter(result);
    }

    public void save(XMLStreamReader reader, XMLStreamWriter writer) throws XMLStreamException {
        XMLStreamSerializer serializer = new XMLStreamSerializer(isReparingNamespaces());
        serializer.serialize(reader, writer);
        writer.flush();
    }
View Full Code Here

                                 String namespaceURI,
                                 String value) throws XMLStreamException {
        if (value == null) {
            return null;
        }
        XMLStreamSerializer serializer = new XMLStreamSerializer(isReparingNamespaces());
        return serializer.writeAttribute(writer, prefix, localName, namespaceURI, value);
    }
View Full Code Here

        writeStartElement(writer, name.getPrefix(), name.getLocalPart(), name.getNamespaceURI());
    }

    public void writeStartElement(XMLStreamWriter writer, String prefix, String localName, String namespaceURI)
        throws XMLStreamException {
        XMLStreamSerializer serializer = new XMLStreamSerializer(isReparingNamespaces());
        serializer.writeStartElement(writer, prefix, localName, namespaceURI);
    }
View Full Code Here

        XMLStreamSerializer serializer = new XMLStreamSerializer(isReparingNamespaces());
        serializer.writeStartElement(writer, prefix, localName, namespaceURI);
    }

    public String writeNamespace(XMLStreamWriter writer, String prefix, String namespaceURI) throws XMLStreamException {
        XMLStreamSerializer serializer = new XMLStreamSerializer(isReparingNamespaces());
        return serializer.writeNamespace(writer, prefix, namespaceURI);
    }
View Full Code Here

    }

    @Test
    public void testReader() throws Exception {
        XmlTreeStreamReaderImpl reader = new XmlTreeStreamReaderImpl(root);
        XMLStreamSerializer serializer = new XMLStreamSerializer();
        StringWriter sw = new StringWriter();
        XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
        outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE);
        XMLStreamWriter writer = outputFactory.createXMLStreamWriter(sw);
        serializer.serialize(reader, writer);
        String xml = sw.toString();
        XMLAssert.assertXMLEqual(XML_RESULT, xml);
    }
View Full Code Here

    }

    @Test
    public void testReader() throws Exception {
        XmlTreeStreamReaderImpl reader = new XmlTreeStreamReaderImpl(root);
        XMLStreamSerializer serializer = new XMLStreamSerializer();
        StringWriter sw = new StringWriter();
        XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
        outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE);
        XMLStreamWriter writer = outputFactory.createXMLStreamWriter(sw);
        serializer.serialize(reader, writer);
        String xml = sw.toString();
        XMLAssert.assertXMLEqual(XML_RESULT, xml);
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.common.xml.stax.impl.XMLStreamSerializer

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.