Chapter 1. General use
This is just an overview, consult the JavaDoc for more details.
1 |String input = "date: s?, day, -s, month, (-s, year)? .\n" +
|"-s: -\" \"+ .\n" +
|"day: digit, digit? .\n" +
|"-digit: \"0\"; \"1\"; \"2\"; \"3\"; \"4\"; \"5\"; \"6\"; \"7\"; \"8\"; \"9\".\n" +
5 |"month: \"January\"; \"February\"; \"March\"; \"April\";\n" +
|" \"May\"; \"June\"; \"July\"; \"August\";\n" +
|" \"September\"; \"October\"; \"November\"; \"December\".\n" +
|"year: ((digit, digit); -\"'\")?, digit, digit .";
|10 |
InvisibleXmlParser parser ①
|= new InvisibleXml().getParserFromIxml(input);
||
InvisibleXmlDocument doc ②
|= parser.parse("27 Feb 2022");
15 ||
String result = doc.getTree(); ③
- ①
Create a parser. In early versions of this API, the
InvisibleXml
class had static methods. In version 0.6.0, that was changed. It must now be instantiated and theParserOptions
to use can be specified.- ②
Parse some input.
In the case of a failed parse, the
InvisibleXmlDocument
will also provide details about the failure.- ③
Get the XML.
Several tree models can be constructed and the parse tree can be sent to any SAX document builder.