W
werwer
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.
THanks)
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.
THanks)