Package snap.util
Class XMLParser
java.lang.Object
snap.parse.Parser
snap.util.XMLParser
A class to load an XMLElement from aSource.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Attribute Handler: Attribute { Name "=" String }static class
Document Handler: Document { Prolog? DocType? Element }static class
Element Handler: Element { "<" Name Attribute* ("/>" | (">" Content "</" Name ">")) }static class
Prolog Handler: Prolog { "<?xml" Attribute* "?>" }static class
A Tokenizer subclass to read XML contents.Nested classes/interfaces inherited from class snap.parse.Parser
Parser.HandlerRef
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Tokenizer
Override to return XMLTokenizer.static void
Test.parseXMLFromSource
(Object aSource) Kicks off xml parsing from given source and builds on this parser's element.parseXMLFromString
(String xmlString) Kicks off xml parsing from given source and builds on this parser's element.Methods inherited from class snap.parse.Parser
clearTokens, createNode, createRule, getCharIndex, getInput, getLastValidToken, getLookAheadToken, getNextToken, getRule, getRule, getToken, getTokenizer, initRule, lookAhead, parse, parse, parse, parse, parseCustom, parseCustom, parseCustom, parseFailed, setCharIndex, setInput, setRule, setTokenizer
-
Constructor Details
-
XMLParser
public XMLParser()Creates a new XMLParser.
-
-
Method Details
-
parseXMLFromSource
Kicks off xml parsing from given source and builds on this parser's element.- Throws:
Exception
-
parseXMLFromString
Kicks off xml parsing from given source and builds on this parser's element.- Throws:
Exception
-
createTokenizer
Override to return XMLTokenizer.- Overrides:
createTokenizer
in classParser
-
main
Test.- Throws:
Exception
-