how to search for a attribute value in an xml

Discussion in 'Perl Misc' started by prem, Jun 1, 2006.

  1. prem

    prem Guest

    Hi Gurus,

    Below is the XML input file,can i use evaluate function for the xpath
    to confirm if david exists in this xml file. The function output can
    be a boolean .if so how?

    <?xml version="1.0" encoding="UTF-8"?>
    <perl>
    <Component name="Manager">
    <employee name="David">
    <properties year="1996">
    <property Designation>APM</property>
    <property salary>64693</property>
    </properties>
    </employee>
    <employee name="John">
    <properties year="1996">
    <property Designation>APM1</property>
    <property salary>64693</property>
    </properties>
    </employee>
    <employee name="Rose">
    <properties year="1996">
    <property Designation>PM</property>
    <property salary>64693</property>
    </properties>
    </employee>
    </Component>
    </perl>


    --Thanks in advance
    prem
     
    prem, Jun 1, 2006
    #1
    1. Advertising

  2. prem

    Matt Garrish Guest

    "prem" <> wrote in message
    news:...
    > Hi Gurus,
    >
    > Below is the XML input file,can i use evaluate function for the xpath
    > to confirm if david exists in this xml file. The function output can
    > be a boolean .if so how?
    >
    > <?xml version="1.0" encoding="UTF-8"?>


    What are you using to parse the file? XML::Libxml supports XPATH. See the
    docs for more info.

    Matt
     
    Matt Garrish, Jun 1, 2006
    #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. Replies:
    2
    Views:
    1,091
    Henry S. Thompson
    Mar 6, 2006
  2. Replies:
    1
    Views:
    4,376
    Joe Kesselman
    Aug 2, 2006
  3. Replies:
    8
    Views:
    532
  4. =?UTF-8?b?5byg6Z+h5q2m?=
    Replies:
    3
    Views:
    734
    DeepthiShri
    Oct 23, 2006
  5. Abby Lee
    Replies:
    5
    Views:
    447
    Abby Lee
    Aug 2, 2004
Loading...

Share This Page