471,342 Members | 1,772 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,342 software developers and data experts.

xml parser 101 - $current_element

Hey I'm just starting this ... so have mercy.

I'm spinning up some examples in "XML and Perl" Riehl & Sterin
(Did New Riders publishing go out of business?)

In their examples they parse files with a global value
called $current_element, assigned by the callback start_element().

Just a quick question. Seems that if a substructure uses
the same element name, you won't know where you are. If 'name' is
used in, say an employee section, and then again in his pet's
name, how will the callback know which name?

I would have guessed that $current_element was "appended" as the
parse drilled, but doesn't seem to work that way. start_element()
simply gives the present elements name.

Is it up to me to remember where I am?

(Sorry if this is too Perly. It's all I know. I post there too.

Jul 24 '05 #1
0 797

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

13 posts views Thread by Paulo Pinto | last post: by
3 posts views Thread by Himanshu Garg | last post: by
5 posts views Thread by thewarden | last post: by
28 posts views Thread by Marc Gravell | last post: by
18 posts views Thread by Just Another Victim of the Ambient Morality | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.