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

Re: Re: Getting the XPath of a node

Subject: Re: Re: Getting the XPath of a node
From: Mike Brown <mike@xxxxxxxx>
Date: Wed, 4 Sep 2002 10:39:21 -0600 (MDT)
getting by xpath
Dimitre Novatchev wrote:
> This will produce an XPath expression, which (while covering the node)
> is not unique and probably returns some other nodes in addition to the
> current node.
> 
> An XPath expression, which evaluates to a single node, must include
> predicates showing the positions of the elements forming the path.

Yes, you're right. That's what I get for posting at 4:00 in the morning.

However -- not that I was shooting for this -- he didn't give uniqueness as a
criteria, did he? :) He didn't say what he wanted these paths for. I guess as
a learning tool? Hopefully he's not going to try to put them in variables and
evaluate them without extensions. Anyway, it may still be valuable, if he sees
that input like this

<foo>
  <Person id="1">
    <Company>Netscape</Company>
  </Person>
  <Person id="2">
    <Company>Microsoft</Company>
  </Person>
  <Person id="3">
    <Company>Sun</Company>
  </Person>
</foo>

...produces output like this

1: /foo/Person/Company
2: /foo/Person/Company
3: /foo/Person/Company

it might make him think, "aha! /foo/Person/Company picks up all 3!" which
might be what he wanted. Then again, it might confuse him more if he's
wondering why xsl:value-of select="/foo/Person/Company" generates just 
"Netscape". Oh well.

   - Mike
____________________________________________________________________________
  mike j. brown                   |  xml/xslt: http://skew.org/xml/
  denver/boulder, colorado, usa   |  resume: http://skew.org/~mike/resume/

 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.