Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > how to search for a attribute value in an xml

Reply
Thread Tools

how to search for a attribute value in an xml

 
 
prem
Guest
Posts: n/a
 
      06-01-2006
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

 
Reply With Quote
 
 
 
 
Matt Garrish
Guest
Posts: n/a
 
      06-01-2006

"prem" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
xslt: how to use value from xml data as an attribute value in output html? =?UTF-8?b?5byg6Z+h5q2m?= XML 3 10-23-2006 02:31 PM
Change the value of an attribute according to the value of another attribute patrizio.trinchini@googlemail.com XML 8 08-22-2006 02:53 PM
wrapping long attribute value (line-continuation for attribute value) lophiomys@gmx.at XML 1 08-02-2006 01:18 PM
[XML] filling empty attribute values with the default value specifiedin the XML schema. Stefan Siegl Java 1 07-28-2003 06:18 PM



Advertisments