RE: [xsl] XPath Question

Subject: RE: [xsl] XPath Question
From: "Emmanuel Oviosa" <Emmanuel.Oviosa@xxxxxxxxx>
Date: Fri, 12 Jul 2002 13:55:59 +0100
Problem solved guys, thanks. Now I will try and do it all in XSLT.

-----Original Message-----
From: Emmanuel Oviosa [mailto:Emmanuel.Oviosa@xxxxxxxxx]
Sent: 12 July 2002 10:31
To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] XPath Question


This question might not be appriopiate here but please do forgive me.

I am interested in getting the ID attribute that is present in each Region
Node, I know that I can do 
RegionID =
objXMLDoc.selectSingleNode("/CRegions/Regions/Region[2]/@ID").nodeTypedValue
to get the attribute for the second region none but I want to iterate
through the Region nodes and get the ID attributes text. 

set regionsNodeList = objXMLDoc.selectNodes("/CRegions/Regions/Region")
intRegions = regionsNodeList.length 
for intCount = 1 to intRegions 
	
	' there are multiple Region nodes so get me the next node 
	set RegionNode = regionsNodeList.nextNode() 
	RegionID =
objXMLDoc.selectSingleNode("/CRegions/Regions/Region/@ID").nodeTypedValue 
	
	' get the RegionNode value
	RegionNode.nodeTypedValue 

	' get the ID attribute
next 

XML string: "<CRegions><Regions><Region ID='1'>Bristol</Region><Region
ID='2'>London</Region></Regions></CRegions>" 

Thanks guys






The contents of this email and any attachments may be privileged or
confidential, for the exclusive use of the intended recipient(s) only and
may not be disclosed or used in any way other than by the addressee(s). If
you have  received this email in error please advise the sender and delete
from your system.

Integrated Solutions Consultants Ltd are unable to guarantee the security of
email content outside of our own systems where all emails and content are
treated in accordance with the Regulation of Investigatory Powers Act 2000.

Further information about Integrated Solutions Consultants Ltd is available
at http://www.isc.co.uk or mailto:info@xxxxxxxxx

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


The contents of this email and any attachments may be privileged or confidential, for the exclusive use of the intended recipient(s) only and may not be disclosed or used in any way other than by the addressee(s). If you have  received this email in error please advise the sender and delete from your system.

Integrated Solutions Consultants Ltd are unable to guarantee the security of email content outside of our own systems where all emails and content are treated in accordance with the Regulation of Investigatory Powers Act 2000.

Further information about Integrated Solutions Consultants Ltd is available at http://www.isc.co.uk or mailto:info@xxxxxxxxx

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread