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

Re: key declarations (using a sequence constructor)

Subject: Re: key declarations (using a sequence constructor)
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 7 Oct 2009 12:38:07 +0100
Re:  key declarations (using a sequence constructor)
> Do they just make a string with some kind of separator
> breaking up the attributes?

usually, yes.

> Isn't there a chance of this failing if the character used for the
> separator is used in one or more of the attributes?

In theory, in general, yes, but in practice there are usually characters
that can not be, or extremely unlikley to be, in the attribute. For
example if the attributes are ID they can not have letters that are not
in XML names, for example |, of if the markup is in a general natural
language document it's unlikely to have unassigned private use
characters such as &#x100000; which can be useful as delimiters.

Or of course you can use 2 keys.

<xsl:key match="name"
              use="string-join((@oid, @parent-oid), '|')"/>
...
key('name',string-join((@oid, ../@oid), '|'))

could be instead:

<xsl:key match="namea" use="@oid"/>
<xsl:key match="nameb" use="@parent-oid"/>
...
key('namea',@oid) intersect key('nameb',../@oid)

David


________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________

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.