XML attributes and values

S

Saya

Hi,

Is there someone who cn help me with the following:

<data>

<tuple name="Abb">ARG</tuple>

<tuple name="Reg">EU</tuple>

</data>

assuming a XML document as above with alot of data tags containing
tuple tags. I want to find all tuples that have a name value equals to
"Reg" and extract the tags value (eg. EU). How do I achieve that in
Perl.
 
T

Tad McClellan

Saya said:
<data>
<tuple name="Abb">ARG</tuple>
<tuple name="Reg">EU</tuple>
</data>

assuming a XML document as above with alot of data tags containing
tuple tags.


What you describe is not possible in XML.

Tags cannot contain tags.

Elements can contain elements though, so that must be what you meant...?


See the XML FAQ:

http://www.ucc.ie:8080/cocoon/xmlfaq#makeup

then use the proper terminology.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top