Subject: Re: [xsl] Processing IDREFS attributes From: Dan Vint <dvint@xxxxxxxxx> Date: Tue, 01 Nov 2005 16:08:15 -0800 |
*If* you have properly declared the id attributes, for my example they are called id=, something along the lines of:
<!ATTLIST foo id ID #IMPLIED>
then you should be able to say:
<xsl:for-each select="id(@references)/@id"> <xsl:if test="position()>1"> </xsl:if> <xsl:value-of select="."/> </xsl:for-each>
<xsl:for-each select="id(@references)/@id"> <xsl:value-of select="id(.)"/> </xsl:for-each>
With my original code with added context: <xsl:templete match='foo'> <xsl:for-each select="id(@references)"> <xsl:value-of select="."/> </xsl:for-each> </xsl:template>
and it would report a space-separated list of unique token values (rather than just @references since that might have duplicates).
If you don't have a declaration of the attribute type, then id() has nothing to look up and will always return an empty node set.
I hope this helps, Dan.
..dan --------------------------------------------------------------------------- Danny Vint
Specializing in Panoramic Images of California and the West http://www.dvint.com
When H.H. Bennett was asked why he preferred to be out shooting landscapes rather than spending time in his portrait studio:
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Processing IDREFS attribu, G. Ken Holman | Thread | Re: [xsl] Processing IDREFS attribu, G. Ken Holman |
Re: [xsl] matching template with ar, David Carlisle | Date | [xsl] Found the problem : Re: [xsl], Dan Vint |
Month |