For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > July 2005 > xml 101 - element names









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author xml 101 - element names
werwer

2005-07-24, 8:29 pm

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?

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com