to JSONArray
Convert a well-formed (but not necessarily valid) XML string into a JSONArray using the JsonML transform. Each XML tag is represented as a JSONArray in which the first element is the tag name. If the tag has attributes, then the second element will be JSONObject containing the name/value pairs. If the tag contains children, then strings and JSONArrays will represent the child tags. Comments, prologs, DTDs, and
<[ [ ]]>
Return
A JSONArray containing the structured data from the XML string.
Parameters
The source string.
Throws
Thrown on error converting to a JSONArray
Convert a well-formed (but not necessarily valid) XML string into a JSONArray using the JsonML transform. Each XML tag is represented as a JSONArray in which the first element is the tag name. If the tag has attributes, then the second element will be JSONObject containing the name/value pairs. If the tag contains children, then strings and JSONArrays will represent the child tags. As opposed to toJSONArray this method does not attempt to convert any text node or attribute value to any type but just leaves it as a string. Comments, prologs, DTDs, and
<[ [ ]]>
Return
A JSONArray containing the structured data from the XML string.
Parameters
The source string.
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 JSONArray
Convert a well-formed (but not necessarily valid) XML string into a JSONArray using the JsonML transform. Each XML tag is represented as a JSONArray in which the first element is the tag name. If the tag has attributes, then the second element will be JSONObject containing the name/value pairs. If the tag contains children, then strings and JSONArrays will represent the child content and tags. As opposed to toJSONArray this method does not attempt to convert any text node or attribute value to any type but just leaves it as a string. Comments, prologs, DTDs, and
<[ [ ]]>
Return
A JSONArray containing the structured data from the XML string.
Parameters
An XMLTokener.
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 JSONArray
Convert a well-formed (but not necessarily valid) XML string into a JSONArray using the JsonML transform. Each XML tag is represented as a JSONArray in which the first element is the tag name. If the tag has attributes, then the second element will be JSONObject containing the name/value pairs. If the tag contains children, then strings and JSONArrays will represent the child content and tags. Comments, prologs, DTDs, and
<[ [ ]]>
Return
A JSONArray containing the structured data from the XML string.
Parameters
An XMLTokener.
Throws
Thrown on error converting to a JSONArray