to JSONObject
Convert a well-formed (but not necessarily valid) XML string into a JSONObject using the JsonML transform. Each XML tag is represented as a JSONObject with a "tagName" property. If the tag has attributes, then the attributes will be in the JSONObject as properties. If the tag contains children, the object will have a "childNodes" property which will be an array of strings and JsonML JSONObjects. Comments, prologs, DTDs, and
<[ [ ]]>
Return
A JSONObject containing the structured data from the XML string.
Parameters
The XML source text.
Throws
Thrown on error converting to a JSONObject
Convert a well-formed (but not necessarily valid) XML string into a JSONObject using the JsonML transform. Each XML tag is represented as a JSONObject with a "tagName" property. If the tag has attributes, then the attributes will be in the JSONObject as properties. If the tag contains children, the object will have a "childNodes" property which will be an array of strings and JsonML JSONObjects. Comments, prologs, DTDs, and
<[ [ ]]>
Return
A JSONObject containing the structured data from the XML string.
Parameters
The XML source text.
If true, then values will not be coerced into boolean or numeric values and will instead be left as strings
Throws
Thrown on error converting to a JSONObject
Convert a well-formed (but not necessarily valid) XML string into a JSONObject using the JsonML transform. Each XML tag is represented as a JSONObject with a "tagName" property. If the tag has attributes, then the attributes will be in the JSONObject as properties. If the tag contains children, the object will have a "childNodes" property which will be an array of strings and JsonML JSONObjects. Comments, prologs, DTDs, and
<[ [ ]]>
Return
A JSONObject containing the structured data from the XML string.
Parameters
An XMLTokener of the XML source text.
Throws
Thrown on error converting to a JSONObject
Convert a well-formed (but not necessarily valid) XML string into a JSONObject using the JsonML transform. Each XML tag is represented as a JSONObject with a "tagName" property. If the tag has attributes, then the attributes will be in the JSONObject as properties. If the tag contains children, the object will have a "childNodes" property which will be an array of strings and JsonML JSONObjects. Comments, prologs, DTDs, and
<[ [ ]]>
Return
A JSONObject containing the structured data from the XML string.
Parameters
An XMLTokener of the XML source text.
If true, then values will not be coerced into boolean or numeric values and will instead be left as strings
Throws
Thrown on error converting to a JSONObject