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

Examples of org.apache.tuscany.sca.databinding.json.XMLStreamReader2JSON.transform()


    private static final String JSON_STR = "{\"xsl:root\":{\"@xmlns\":{\"xsl\":\"http://foo.com\"},\"data\":{\"$\":\"my json string\"}}}";

    public void testXML2JSON() throws Exception {
        XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(IPO_XML));
        XMLStreamReader2JSON t1 = new XMLStreamReader2JSON();
        JSONObject json = t1.transform(reader, null);
        Assert.assertNotNull(json);

        // Cannot round-trip as we hit a bug in Jettison
        /*
         JSON2XMLStreamReader t2 = new JSON2XMLStreamReader();
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.