XML attributes and values

Discussion in 'Perl Misc' started by Saya, Jul 14, 2003.

  1. Saya

    Saya Guest

    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.
    Saya, Jul 14, 2003
    #1
    1. Advertising

  2. Saya <> wrote:

    ><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.


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
    Tad McClellan, Jul 20, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jordan Willms
    Replies:
    2
    Views:
    820
    Richard Tobin
    Nov 9, 2004
  2. P4trykx
    Replies:
    2
    Views:
    1,786
    bruce barker
    Jan 31, 2007
  3. Replies:
    3
    Views:
    2,783
  4. Dhurandhar Bhatvadekar
    Replies:
    5
    Views:
    601
    Joe Kesselman
    Nov 8, 2006
  5. Erik Sargent
    Replies:
    1
    Views:
    180
    Dan Rogers
    Nov 11, 2004
Loading...

Share This Page