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

RE: using document in xsl:key match...

Subject: RE: using document in xsl:key match...
From: "M. David Peterson" <m.david@xxxxxxxxxx>
Date: Mon, 10 May 2004 12:37:22 -0600
xsl key document
A key needs to be set up as a generic reference.  As such it wont accept
variables or the document function as values.  Simply set the values of
use and match to the elements or attributes you are trying to index and
then within your stylesheet use it with the key function within a block
of code whose context is set to the point where the values of the xpath
contained in the match and use attributes evaluate correctly.

See Jeni Tennisons site for a better understanding of how to use keys
with variables and/or the document function.

http://www.jenitennison.com/xslt/index.html 

Best of luck...

<M:D/>

-----Original Message-----
From: John-Mark Gurney [mailto:jgurney@xxxxxxxxxxx] 
Sent: Monday, May 10, 2004 12:28 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  using document in xsl:key match...

I am using the libxslt from the GNOME project
(http://xmlsoft.org/XSLT/).
I would like to confirm that this is a bug, and not a design issue.

I am trying to use xsl:key to index a set of elements from another
document.
When I try to do:
<xsl:key match="document('ed.xml')/root/sup" use="@name"/>
I get:
XPath error : Invalid expression
//document('ed.xml')/root/sup
           ^
compilation error: file tb.xml line 7 element key
xsl:key : XPath pattern compilation failed
'//document('ed.xml')/root/sup'

It appears that a // is being prepended to my XPath query, which is
causing
it to fail.  Is this suppose to be a valid construct (using document in
an xsl:key match term)?  Or is this a bug in the library?

After additional reading of: http://www.w3.org/TR/xslt#NT-Pattern
It appears this construct is not allowed.  Is this correct?

-- 
John-Mark Gurney
nCircle Network Security, Inc.

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.