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

RE: Complex XPath Expression

Subject: RE: Complex XPath Expression
From: "Karl Stubsjoen" <karl@xxxxxxxxxxxxxxxxxxxx>
Date: Fri, 14 Jan 2005 20:14:28 -0700
complex xpath expressions
Thanks for the tip Michael.
Oh but darn it, I just downloaded this app called Visual XPath and it does
not like the current() function.  (It will be Tuesday before I test this in
code with MSXML parser).

Does anyone recommend a free XSL XPath visualizer app?

Karl

-----Original Message-----
From: Michael Kay [mailto:mike@xxxxxxxxxxxx]
Sent: Saturday, January 15, 2005 2:36 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  Complex XPath Expression


The second expression depends on the context node, and the context is
different inside a predicate. Try replacing recordset[] with
current()/recordset[].

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: Karl Stubsjoen [mailto:kstubs@xxxxxxxxx]
> Sent: 15 January 2005 01:14
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Complex XPath Expression
>
> Hello,
>
> I have an xpath query that works in each of it's respective pieces but
> does not return a desired result when combined.
>
> Here is the complete expressions, followed by an explanation
> of it's parts:
>
> COMPLETE:
> recordset[@rsName='Codes']/record[field[@fieldname='Section']=
> '2'][field[@fieldname='ID']
> =
> recordset[@rsName='Memberships']/record[1]/field[@fieldname='R
> efEntryActivityID']]
>
>
> 1ST PART:
> recordset[@rsName='Codes']/record[field[@fieldname='Section']=
> '2'][field[@fieldname='ID']
>
> >> Alone, this correctly produces a result set of 15 matching nodes.
>
> 2ND PART:
> recordset[@rsName='Memberships']/record[1]/field[@fieldname='R
> efEntryActivityID']
>
> >> Alone, this retrieves the node who's value is 2913.
>
> If I rewrite the complete expression like this:
> recordset[@rsName='Codes']/record[field[@fieldname='Section']=
> '2'][field[@fieldname='ID']
> = 2913]
>
> >> I do match one node which is the desired result.
>
> What is wrong with the complete expression?  Both the 1st part and 2nd
> part behave accordingly, but combined not.
>
> Thanks for the help!
>
> Karl

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.