intro
Modeltools, shelltools and clicktools all use XML documents
extensively - for model definition and for many related
tasks. The majority of model tools have an XML parser and
some even have two XML parsers (e.g. the job tools).
The reason for having two XML parsers in a tool is that these
parsers are not reentrant and sometimes a second document
must be parsed while a first document is being parsed.
Types Of XML Parsers<
There are basically two types of XML parsers.
-
DOM (for Document Object Model). A DOM parser (also called a
tree-based parser) parses an entire document into a tree
before document analysis is initiated. This means that
parsing can be undertaken without prior knowledge of the
schema used to create the document. All that is required
is valid XML grammar. DOM parsers can be slow and memory
intensive.
-
SAX (for Simple API for XML). A SAX parser (also called an
event-based parser) parses a document one tag at a time (with
specific tags triggering parser events). The parser must know
the schema that was used to create the document. SAX parsers
are fast and memory frugal.