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

Re: selecting from multiple different node sets

Subject: Re: selecting from multiple different node sets
From: "Sebastian Rahtz" <sebastian.rahtz@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 18 Jun 1999 21:57:49 +0100 (BST)
Re: selecting from multiple different node sets
Zakon, Stuart writes:
 > <xsl:apply-templates select='//Circle[@ID=normalize($target)]'/>
 > <xsl:apply-templates select='//Square[@ID=normalize($target)]'/>
 > 
 > However what I want to do is say "find me the name of EITHER the Circle or
 > the Square 
 > that has an attribute 'ID' equal to a specified value. ID is unique but I
 > don't

Unless I misunderstand, you just do

<xsl:apply-templates select="id($target)"/>

since the id() function goes straight to the right element, with no
need for any more qualification. That assumes that the ID attribute is 
declared as of type ID in the DTD. If I remember something I read at
Microsoft, their XSL would mean it had to be called "xml:id", because
they don't read the DTD? something like that.

I was delighted to find that id() function. It meant that from
 <code id="GB">Great Britain</code>
 ..
 <nat idref="GB"/>

I could get the <nat> to generate "Great Britain" with just
   <xsl:apply-templates select="id(@idref)"/>

Moving all my code lookup tables into the main XML file made by feel
better for, well, minutes.

Sebastian


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.