This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: XPath Question
- From: "Emmanuel Oviosa" <Emmanuel dot Oviosa at isc dot co dot uk>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Fri, 12 Jul 2002 13:55:59 +0100
- Subject: RE: [xsl] XPath Question
- Reply-to: xsl-list at lists dot mulberrytech dot com
Problem solved guys, thanks. Now I will try and do it all in XSLT.
-----Original Message-----
From: Emmanuel Oviosa [mailto:Emmanuel.Oviosa@isc.co.uk]
Sent: 12 July 2002 10:31
To: XSL-List@lists.mulberrytech.com
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@isc.co.uk
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@isc.co.uk
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list