j = XML.toJSONObject("<![CDATA[This is a collection of test patterns and examples for us.monoid.json.]]> Ignore the stuff past the end. "); System.out.println(j.toString()); System.out.println(""); j = XML.toJSONObject(s); System.out.println(j.toString(2)); System.out.println(XML.toString(j)); j = XML.toJSONObject(s); System.out.println(j.toString(4)); System.out.println(); j = XML.toJSONObject(s); System.out.println(j.toString(4)); j = XML.toJSONObject(s); System.out.println(j.toString(2)); System.out.println(XML.toString(j)); j = XML.toJSONObject(s); j = XML.toJSONObject("<?xml version=\"1.0\" ?><Book Author=\"Anonymous\"><Title>Sample Book</Title><Chapter id=\"1\">This is chapter 1. It is not very long or interesting.</Chapter><Chapter id=\"2\">This is chapter 2. Although it is longer than chapter 1, it is not any more interesting.</Chapter></Book>"); System.out.println(j.toString(2)); System.out.println(XML.toString(j)); System.out.println(""); j = XML.toJSONObject("<!DOCTYPE bCard 'http://www.cs.caltech.edu/~adam/schemas/bCard'><bCard><?xml default bCard firstname = '' lastname = '' company = '' email = '' homepage = ''?><bCard firstname = 'Rohit' lastname = 'Khare' company = 'MCI' email = 'khare@mci.net' homepage = 'http://pest.w3.org/'/><bCard firstname = 'Adam' lastname = 'Rifkin' company = 'Caltech Infospheres Project' email = 'adam@cs.caltech.edu' homepage = 'http://www.cs.caltech.edu/~adam/'/></bCard>"); System.out.println(j.toString(2)); System.out.println(XML.toString(j));
j = XML.toJSONObject("<![CDATA[This is a collection of test patterns and examples for us.monoid.json.]]> Ignore the stuff past the end. "); System.out.println(j.toString()); System.out.println(""); j = XML.toJSONObject(s); System.out.println(j.toString(2)); System.out.println(XML.toString(j)); j = XML.toJSONObject(s); System.out.println(j.toString(4)); System.out.println(); j = XML.toJSONObject(s); System.out.println(j.toString(4)); j = XML.toJSONObject(s); System.out.println(j.toString(2)); System.out.println(XML.toString(j)); j = XML.toJSONObject(s); j = XML.toJSONObject("<?xml version=\"1.0\" ?><Book Author=\"Anonymous\"><Title>Sample Book</Title><Chapter id=\"1\">This is chapter 1. It is not very long or interesting.</Chapter><Chapter id=\"2\">This is chapter 2. Although it is longer than chapter 1, it is not any more interesting.</Chapter></Book>"); System.out.println(j.toString(2)); System.out.println(XML.toString(j)); System.out.println(""); j = XML.toJSONObject("<!DOCTYPE bCard 'http://www.cs.caltech.edu/~adam/schemas/bCard'><bCard><?xml default bCard firstname = '' lastname = '' company = '' email = '' homepage = ''?><bCard firstname = 'Rohit' lastname = 'Khare' company = 'MCI' email = 'khare@mci.net' homepage = 'http://pest.w3.org/'/><bCard firstname = 'Adam' lastname = 'Rifkin' company = 'Caltech Infospheres Project' email = 'adam@cs.caltech.edu' homepage = 'http://www.cs.caltech.edu/~adam/'/></bCard>"); System.out.println(j.toString(2)); System.out.println(XML.toString(j));