|
|
|
good chemistry is complicated, and a little bit messy -LW |
|
| PerlMonks |
RE: RE: RE: XML::Parserby btrott (Parson) |
| on Jun 20, 2000 at 19:57 UTC ( [id://19090]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
You can keep a stack of the current level where you are
in the XML file. When you get a start tag, push the
tag onto the stack; when you get to the end of that tag,
pop the tag off the stack. You can use this to define a
tree structure of sorts. Another option would be to use the "Tree" Style of XML::Parser. Read the docs for that. A final option, and a good one, is to use XML::Simple, which may work for you: It loads the data into a tree structure, which may or may not work exactly how you want it. Or (finally again) you could look into some of the other tree-processing XML modules, like XML::DOM and XML::Twig. They may be overkill for your purposes, though.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||