List Info

Thread: regarding XPATH




regarding XPATH
user name
2006-12-23 06:38:12
Hi
I have a problem with xpath values

I have a XML file. From that i want to generate the Xpath
node values

For example (following is the XML file):

<root>
	<system>
		<name>XYZ</name>
		<id>10.10.10.10</id>
		<internalexternal>
			<ram>512mb</ram>
		</internalexternal>
		<externaldevice>
			<fdd>1.4</fdd>
			<hdd>40GB</hdd>
			<moniter>21in</moniter>
			<printer>8100HP</printer>
		</externaldevice>
	</system>
	<system>
		<name>XYA</name>
		<id>10.10.10.11</id>
		<internalexternal>
			<ram>512mb</ram>
		</internalexternal>
		<externaldevice>
			<fdd>1.4</fdd>
			<moniter>15in</moniter>
			<printer>8100HP</printer>
			<hdd>80GB</hdd>
		</externaldevice>
	</system>
	<system>
		<name>XYB</name>
		<id>10.10.10.12</id>
		<internalexternal>
			<ram>512mb</ram>
		</internalexternal>
		<externaldevice>
			<hdd>160GB</hdd>
			<fdd>1.4</fdd>
			<moniter>14in</moniter>
			<printer>8100HP</printer>
		</externaldevice>
	</system>
</root>


i want all "hdd" values from the root in XPATH
syntax

Like this
For first system:
//[1]/[2]/[2]

For second system:
//[1]/[2]/[4]

For third system:
//[1]/[2]/[1]


Do we have any perl module to get the node values

Please help me how to get the values

Thanks in advance
Samuel N



Unsubscribing info is here: h
ttp://help.yahoo.com/help/us/groups/groups-32.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://g
roups.yahoo.com/group/perl-beginner/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http
://groups.yahoo.com/group/perl-beginner/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:perl-beginner-digest@yahoogroups.com 
    mailto:perl-beginner-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    perl-beginner-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.c
om/info/terms/
 
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )