Strategies
Basically we can use a functional or an object oriented
programming approach. We will start using functions to
handle the parsing.
When using functions we need to
- • Create callback functions
to handle start and end tags, content, attributes,
etc.
- • Keep track of where in
the parsing process we are by using a stack structure
and/or a group of global variables.
- • Plan carefully the structure to generate
from the XML document.
Let's use a simple XML file and code to
handle it ...