[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: keys and idrefs
Hi Dave,
At 06:40 AM 10/9/01, DPawson@xxxxxxxxxxx wrote: > So you'd have > <xsl:for-each select="key('processes-by-control', @id)"> ... Ah! I see, yes. Missed that important subtlety, sorry. Yes, this is considerably trickier. Unless someone (where's Jeni?) can come up with some cunning way to make key() work like id() with a space-delimited list of tokens, I don't see a key solution here. That is, how do I set up a key that will return the node <process id="deliver" control="DIGL WCAG XAG UANegotiation" > <name>Deliver Content</name> </process> when given the value "XAG"? I'm afraid the rather brutal expression "//process[contains(@control, $value)]" where $value is your id, is the only XSLT 1.0 alternative. (And even that's not foolproof. What if you have control="DIGL WCAG XAG UANegotiation" and your id value is "CAG"?) The saxon:tokenize extension method returns a node set when given a list of tokens as a string. If you're using Saxon, you could try <xsl:key name="processes-by-control-token" match="process" use="saxon:tokenize(@control)"/> But general string-chopping methods won't work, since they won't fit into the 'use' attribute on the key declaration. I'd be interested to see what the wizards on this list will come up with. (The schoolteacher says "can't be done".) Cheers, Wendell ====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ====================================================================== XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|