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

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

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:
    966
    Richard Tobin
    Nov 9, 2004
  2. Andy
    Replies:
    0
    Views:
    726
  3. kellner
    Replies:
    0
    Views:
    991
    kellner
    Jul 23, 2006
  4. P4trykx
    Replies:
    2
    Views:
    2,125
    bruce barker
    Jan 31, 2007
  5. Replies:
    3
    Views:
    4,645
  6. Dhurandhar Bhatvadekar
    Replies:
    5
    Views:
    730
    Joe Kesselman
    Nov 8, 2006
  7. Erik Sargent
    Replies:
    1
    Views:
    287
    Dan Rogers
    Nov 11, 2004
  8. Erik Wasser
    Replies:
    5
    Views:
    862
    Peter J. Holzer
    Mar 5, 2006
Loading...