how to search for a attribute value in an xml

P

prem

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
 
M

Matt Garrish

prem said:
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
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top