Parsers as Objects
Essentially, there are two ways a parser will be used in an application:
To see whether an XML document is well-formed
As part of a processor
If the second one is the case (and it will be most of the time), the parser can be treated as an object. With Java-based parsers, this means that the parser will be incorporated as a class in the Java application. With C-based parsers, either the source code can be incorporated natively and the arrays and other variables accessed directly, or the parser can be treated as a class with its own methods and properties.
Another method that can be used with Windows applications is to compile the parser as a DLL and use it as a common object model. In fact, all the C parsers in Chapter 14, "Parsing ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access