Okay, this is the problem:

-I have a tree-like structured XML-document. Now I want my XSLT-stylesheet
to pick that branch of the tree that has a certain URL in it (that URL is
also given to the stylesheetas a parameter). So when I find the URL
somewhere in the XML-file, I want to revisit the parent nodes, printing
out their names before the name of the URL I was looking for

(why I want to do all this: to construct breadcrums given a navigation-map
in the form of that XML-doc and a URL)

-So I planned to make another parameter, initially valued zero. When I
find the URL I'm looking for, I make the parameter's value 1 and with an
<xsl:if test="$found=0"> and $found=1 I can switch between two modes in
the url-handling template rule.

I have a parameter, named found, which will determine whether I have
already found the URL

<xsl:param name="found" select="0"/>


Then I have this template

<xsl:template match="url" name="urltemplate">
<xsl:if test="$found=0">
 <xsl:if test="contains(.,$pageurl)">
   <xsl:if test="normalize-space(../../url)">
     upper level found
     <xsl:call-template name="urltemplate">
      <xsl:with-param name="found" select="1"/>
     </xsl:call-template>
   </xsl:if>
   -
   <a>
    <xsl:attribute name="href">
     <xsl:value-of select="."/>
    </xsl:attribute>
    <xsl:value-of select="../name"/>
   </a>
 </xsl:if>
</xsl:if>
<xsl:if test="$found=1">
 if it gets here, it works but it never does
</xsl:if>
</xsl:template>


In my humble opinion, the least this thing should do, is print "upper
level found" and "if it gets here...." but it doesn't. Can anyone tell me
why it doesn't work?

Thanks a lot,

DjiM ([EMAIL PROTECTED])


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to