Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: How to create an xsl:key using an attribute of an element in another namespace

From: "Dimitre Novatchev" <dimitren@---.---.-->
To: NULL
Date: 2/5/2006 10:54:00 AM
"style" <!spam.g.host@m...> wrote in message 
news:43e53199_3@n......
> Hi everybody
>
> In the following sample I'm trying to create an xsl:key using the 
> @fileExtension attribute of the data:IconInfo elements. Unfortunately this 
> syntax doesn't work. Does anybody have an idea what I'm doing wrong?
>
> <xsl:stylesheet version="1.0" 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
> xmlns:data="http://example/icon-info" extension-element-prefixes="data">
>  <data:IconInfos>
>   <data:IconInfo fileExtension="pdf" iconUrl="Images/icon_pdf.gif" />
>   <data:IconInfo fileExtension="zip" iconUrl="Images/icon_zip.gif" />
>   <data:IconInfo fileExtension="txt" iconUrl="Images/icon_txt.gif" />
>  </data:IconInfos>
>  <xsl:key name="iconInfoLookup" match="data:IconInfos/data:IconInfo" 
> use="@fileExtension"/>
> </xsl:stylesheet>
>
> Kind regards
> Thomas


The <xsl:key> instruction above is a valid one. What do you mean by "is not 
working"?

You haven't shown the code that references this xsl:key using the key() 
function.

Most probably, not getting the expected results is due to the fact that the 
current document is not the one that is intended to be indexed (my guess is 
that the intended one is the stylesheet itself -- if so, make document('') 
the current node and (this is what xsl:for-each is for -- among other 
things)  then in this context evaluate the key() function).


Cheers,
Dimitre Novatchev 




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent