RE: [xml] Stupid Newbie Question about Parsing

You can go either way...

Honestly, I originally went #1, and "walked" the tree.  This was tedious,
buggy, and slow..

That being said, if you know what your tree is going to look like ahead of
time, use xpath.  You can go straight to the node in question, much faster,
easier, and no bugs..

-----Original Message-----
From: xml-admin gnome org [mailto:xml-admin gnome org] On Behalf Of Dan
Sent: Wednesday, March 17, 2004 9:08 AM
To: xml gnome org
Subject: [xml] Stupid Newbie Question about Parsing

I am possibly approaching XML parsing from a wrong direction, so I thought
I'd ask:

Should I expect to be able to blindly parse an XML tree (created with
xmlParseFile ( "file.xml" ) or similar), finding attributes and content
and such dynamically --


Should I be working from a known DTD or XML structure such that I know
which tags have what children and how many ?

If the first one, a few pointers to detailed tree traversal would be
appreciated.  All examples I have found so far seem to concentrate on only
one aspect -- tag names or element content or whatever, but not all

 Thanks in advance.
xml mailing list, project page
xml gnome org

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]