This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: keys and idrefs - XSLT2 request?
- To: xsl-list at lists dot mulberrytech dot com
- Subject: RE: [xsl] keys and idrefs - XSLT2 request?
- From: "G. Ken Holman" <gkholman at CraneSoftwrights dot com>
- Date: Tue, 09 Oct 2001 08:39:06 -0400
- Reply-To: xsl-list at lists dot mulberrytech dot com
At 01/10/09 13:05 +0100, DPawson@rnib.org.uk wrote:
>Either to extend the key function in some way to handle idrefs,
>or to permit a key definition to take in all attributes of type idrefs?
>(I could see the problem where I have a CDATA attribute with spaces,
>but surely idrefs are a bit special?)
I've suggested tokenized access to the key tables in a letter to the XSL
Editors a year ago (almost to the day). I've attached my contribution below.
...................... Ken
>Date: Wed, 11 Oct 2000 04:31:02 +0800
>To: XSL Editors <xsl-editors@w3.org>
>From: "G. Ken Holman" <gkholman@CraneSoftwrights.com>
>Subject: Feature request: tokenized key table access
>
>Hi folks!
>
>I've been using the key() function a lot lately, and I've been using it to
>store name tokens similar to (usually) ID values. I would find it helpful
>if there were a way at declaration time to instruct the processor to
>tokenize the string and make individual key table entries with each
>individual token as the string value.
>
>Also, I understand the need for the second argument of the key() function
>to be a verbatim string, but I would like a function that would tokenize
>the second argument as id() does and return all key table members with a
>value of one of the name tokens.
>
>I am aware that a recursive function could walk through the arguments and
>tokenize them and when done act on the built-up node set ... but it is
>quite awkward. As for the declaration, there is no way to accomplish that.
>
>So, not to ask for the following syntax, but I would envisage something
>like the following for topic maps where attribute arguments are strings of
>multiple name tokens:
>
> <xsl:key name="assocs" match="assoc" use-tokenized="@types | @other"/>
>
> - create as many entries in table as tokens in all given strings
>
> <xsl:variable name="assocs" select="key-tokenized('assocs',refs/@ref)"/>
>
> - return as many entries from table as tokens in all given strings
>
>Thanks!
>
>.............. Ken
--
G. Ken Holman mailto:gkholman@CraneSoftwrights.com
Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (Fax:-0995)
Web site: XSL/XML/DSSSL/SGML/OmniMark services, training, products.
Book: Practical Transformation Using XSLT and XPath ISBN 1-894049-06-3
Article: What is XSLT? http://www.xml.com/pub/2000/08/holman/index.html
Next public instructor-led training: 2001-10-11,10-22,11-01,11-02,
- 11-05,11-19,12-09,12-10
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list