xsl-list
[Top] [All Lists]

RE: Complex XPath Expression

2005-01-14 20:14:28
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(_at_)saxonica(_dot_)com]
Sent: Saturday, January 15, 2005 2:36 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] 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(_at_)gmail(_dot_)com]
Sent: 15 January 2005 01:14
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] 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[(_at_)rsName='Codes']/record[field[(_at_)fieldname='Section']=
'2'][field[(_at_)fieldname='ID']
=
recordset[(_at_)rsName='Memberships']/record[1]/field[(_at_)fieldname='R
efEntryActivityID']]


1ST PART:
recordset[(_at_)rsName='Codes']/record[field[(_at_)fieldname='Section']=
'2'][field[(_at_)fieldname='ID']

Alone, this correctly produces a result set of 15 matching nodes.

2ND PART:
recordset[(_at_)rsName='Memberships']/record[1]/field[(_at_)fieldname='R
efEntryActivityID']

Alone, this retrieves the node who's value is 2913.

If I rewrite the complete expression like this:
recordset[(_at_)rsName='Codes']/record[field[(_at_)fieldname='Section']=
'2'][field[(_at_)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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>