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
(XMLTokener x)
| 274 | * @throws JSONException |
| 275 | */ |
| 276 | public static JSONObject toJSONObject(XMLTokener x) throws JSONException { |
| 277 | return (JSONObject)parse(x, false, null); |
| 278 | } |
| 279 | |
| 280 | |
| 281 | /** |