RE: [xsl] [XSLT] Asking or Update variable

Subject: RE: [xsl] [XSLT] Asking or Update variable
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 12 Mar 2008 11:30:28 -0000
>     <xsl:template match="rdf:RDF">
> 
>       <xsl:for-each select="child::node()[@rdf:ID=$class]">
> 
>              <xsl:for-each select=" child::node()">
>                       
>                      <xsl:if test="name()=$subclass">
> 
>                         <xsl:value-of select="@rdf:resource"/>
>                         <xsl:variable
> name="IsSubclass">True</xsl:variable>
>                                                               
>                      </xsl:if>                     
>                                 
>             </xsl:for-each>                   
>         </xsl:for-each>
>         
>     </xsl:template>
> </xsl:stylesheet>
> 
> I need know value of variable IsSubclass before the tag 
> </xsl:template> 

Bind the variable outside the loop:

<xsl:variable name="IsSubClass"
select="boolean(*[@rdf:ID=$class]/*[name()=$subclass])"/>

Michael Kay
http://www.saxonica.com/

Current Thread