Package org.apache.tuscany.sca.databinding.json

Examples of org.apache.tuscany.sca.databinding.json.XMLStreamSerializer


    public void testJSON2XML() throws Exception {
        JSON2XMLStreamReader t2 = new JSON2XMLStreamReader();
        XMLStreamReader reader2 = t2.transform(new JSONObject(JSON_STR), null);
        StringWriter sw = new StringWriter();
        XMLStreamWriter streamWriter = XMLOutputFactory.newInstance().createXMLStreamWriter(sw);
        new XMLStreamSerializer().serialize(reader2, streamWriter);
        streamWriter.flush();
        Assert.assertTrue(sw.toString()
            .contains("<xsl:root xmlns:xsl=\"http://foo.com\"><data>my json string</data></xsl:root>"));
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.databinding.json.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.