[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Xpath problem

Subject: RE: Xpath problem
From: Jeff Beadle <Jbeadle@xxxxxxxx>
Date: Mon, 4 Mar 2002 16:17:56 -0500
msn hotmail downloading problems path
Hello Kan,

from a ancestor of the desired "value" attribute whose content is '2111':

   //*[@value='2111']


or from anywhere:

   /*//*[@value='2111']


But, be advised that these will bring back all elements (any element) that 
has an attribute named "value" and whose value is '2111'.

If you expected the possiblity of many elements returned, but only care
about the first then you append another predicate to the end of the first 
one to return the first node:

   //*[@value='2111'][1]


or from anywhere:

   /*//*[@value='2111'][1]
  

But since you are using "selectSingleNode" you wouldn't have to worry about
this, it'll always just return the first node from the list of elements 
found.

You may want to look up some information on XPath "Predicates" and how they
work.


-Jeff


-----Original Message-----
From: Kanthi Damodaran [mailto:kdsm17@xxxxxxxxxxx]
Sent: Monday, March 04, 2002 3:30 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  Xpath problem


Hi -

This might seems like a really silly question, dur to my unfamiliarity with 
XPath syntax and functions.  Here is the problem.

I want to specify a path to a specific value in my XML Dom ie Path = 
"//value='2111' and I did this by using the selectSingleNode method of the 
DOM.  But the problem is that it also picks up following values '21112', 
21113' etc.  How do I specify that I want the node ONLY if it is '2111'?

Thanks in advance for the help.
Kan


_________________________________________________________________
Join the world's largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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

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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.