Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: multiple select with xsl:key

From: "Christian Schlemmer" <cs@--------.---->
To: NULL
Date: 4/5/2005 6:34:00 PM
thx for reply,
here is my working code:

<xsl:variable name="dfile" select="document($datafile)"/>
<xsl:key name="pagename" match="siteinfo/pages/page" use="name"/>

<xsl:for-each 
select="document($categoryfile)//categories/category[visible!='off' and 
id!=0 and member='off']">
  <xsl:variable name="catname" select="catname"/>
  <xsl:variable name="catid" select="id"/>
  <xsl:variable name="pagename" select="$dfile[key('pagename', $catname)]"/>

  <xsl:variable name="pageid">
   <xsl:for-each 
select="document($datafile)//siteinfo/pages/page[category=$catid]">
     <xsl:variable name="pid" select="id"/>
     <xsl:value-of select="id"/>
   </xsl:for-each>
  </xsl:variable>

   <xsl:choose>
   <!-- the 'test=' expression converts the returned nodeset of xsl:key to a 
boolean value, therefore it can be requested for true() or false() -->
   <xsl:when test="$pagename">
    ,"<xsl:value-of select="$nbsp"/><xsl:value-of 
select="$not"/><xsl:value-of select="$nbsp"/><xsl:value-of 
select="$catname"/>","default.asp?id=<xsl:value-of 
select="$pageid"/>&amp;mnu=<xsl:value-of 
select="$pageid"/>","","<xsl:value-of select="$catname"/>",0
   </xsl:when>
   <xsl:otherwise>
    ,"<xsl:value-of select="$nbsp"/><xsl:value-of 
select="$not"/><xsl:value-of select="$nbsp"/><xsl:value-of 
select="$catname"/><xsl:value-of select="$nbsp"/>","show-menu=<xsl:value-of 
select="$catname"/>",,"",1
   </xsl:otherwise>
  </xsl:choose>
</xsl:for-each>

regards,
christian schlemmer


"Oleg Tkachenko [MVP]" <oleg@NO!SPAM!PLEASEtkachenko.com> schrieb im 
Newsbeitrag news:%23VzNGtPOFHA.3828@T......
> Christian Schlemmer wrote:
>
>> <xsl:key name="pageid" match="siteinfo/pages/page/id" use="concat(id, 
>> '+', category)"/>
>
>>  <xsl:variable name="pageid" select="$dfile[key('pageid', concat(id, 
>> $catid))]"/>
>
> Shouldn't it be
> <xsl:variable name="pageid" select="$dfile[key('pageid', concat(id, '+', 
> $catid))]"/>
>
> -- 
> Oleg Tkachenko [XML MVP, MCP]
> http://blog.tkachenko.com 




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