You don't need to define which document a key applies to: it applies
automatically to every document.
Michael Kay
Software AG
home: Michael(_dot_)H(_dot_)Kay(_at_)ntlworld(_dot_)com
work: Michael(_dot_)Kay(_at_)softwareag(_dot_)com
-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of
Jerome Louvel
Sent: 11 December 2002 00:20
To: 'xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com'
Cc: Yuri de Wit
Subject: [xsl] Severe limitation of the xsl:key element with
multiple source documents
Hi all,
We use XSLT to process multiple source documents and generate
one result document. Therefore we decided to exclusively use
the document() XPath in front of all our XPath expressions to
address the right source document. Also, all our source
documents are equal "citizens", so we decided to pass an
empty "main" document to Xalan.
But now we need to define XSLT keys in our source documents
so we tried to use the following declaration: <xsl:key
name="key_1" match="document('id:042C5210')/codesTable/entry/value"
use="../code" />
And we discovered that Xalan rejects this because of the
presence of the
document() function call.
After checking the spec we discovered that the "match"
attribute of the xsl:key element must be a pattern
(http://www.w3.org/TR/xslt#NT-Pattern) and not an expression
(http://www.w3.org/TR/xpath#NT-Expr).
This prevents us from declaring any keys in our case which we find to be
a severe limitation in XSLT 1.0. So we checked latest XSLT 2.0 working
draft and found that the same constraint.
Are we missing something?
Is there any other way to define key from multiple source documents?
Many thanks for your help,
Jerome.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list