org.json
public class XMLTokener extends JSONTokener
| Field Summary | |
|---|---|
| static HashMap | entity The table of entity values. |
| Constructor Summary | |
|---|---|
| XMLTokener(String s)
Construct an XMLTokener from a string. | |
| Method Summary | |
|---|---|
| String | nextCDATA()
Get the text in the CDATA block. |
| Object | nextContent()
Get the next XML outer token, trimming whitespace. |
| Object | nextEntity(char a)
Return the next entity. |
| Object | nextMeta()
Returns the next XML meta token. |
| Object | nextToken()
Get the next XML Token. |
Parameters: s A source string.
Returns: The string up to the ]]>.
Throws: JSONException If the ]]> is not found.
Returns: A string, or a '<' Character, or null if there is no more source text.
Throws: JSONException
& ' > < ".Parameters: a An ampersand character.
Returns: A Character or an entity String if the entity is not recognized.
Throws: JSONException If missing ';' in XML entity.
Returns: Syntax characters (< > / = ! ?) are returned as
Character, and strings and names are returned as Boolean. We don't care
what the values actually are.
Throws: JSONException If a string is not properly closed or if the XML is badly structured.
/ > = ! ? or it
may be a string wrapped in single quotes or double quotes, or it may be a
name.Returns: a String or a Character.
Throws: JSONException If the XML is not well formed.