Gianugo Rabellino wrote:
> 
> 
> I'll send you in a minute a temporary download location: I'm uploading
> via my poor ADSL a 15+MB file to a server, it will take some time. :-)
> 
> What I did was just re-warring up for you my current Catalina cocoon
> directory, so that you should *not* encounter any problem (well,
> hopefully ;-)). It's already set up for XSLTC using the jar you sent me.
> 
> In WEB-INF/logs you can also find my attempts to have it working, to no
> avail. The Cocoon front page loads (well, no wonder, being it static
> XHTML) but XSL trasformations don't.
> 
> If you want, we can meet online (irc is my favourite) so that we can try
> interactively to make it work.
> 
> I'll send you the location in a minute (13MB still to go... :-))
> 
> Ciao,
> 
> --
> Gianugo Rabellino
> 

Hi Gianugo,

I got the war you gave me to run and hit the same old error on book2menu.xsl 
that I found before which was due to the stylesheet not using the correct 
syntax to call external java funtions. Here is a copy of the stylesheet 
with the required changes, i.e.

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                
xmlns:NetUtils="http://xml.apache.org/xslt/java/org.apache.cocoon.util.NetUtils";
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

     <xsl:variable name="encLabel" select="NetUtils:encodePath(string(@label))"/>
                                                               ^^^^^^^

These changes should also work with Xalan.

I hope you can submit this fix for the stylesheet, so the version in the wars 
you generate won't have the problem.

After substituting the corrected stylesheet and rebuilding the war, I was able to 
get further and hit a null prt error in XSLTC. We'll investigate that further.

Thanks, 

Tom
<?xml version="1.0"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                
xmlns:NetUtils="http://xml.apache.org/xslt/java/org.apache.cocoon.util.NetUtils";
                version="1.0">

  <xsl:param name="resource"/>

  <xsl:template match="book">
    <menu>
      <xsl:apply-templates/>
    </menu>
  </xsl:template>

  <xsl:template match="project">
  </xsl:template>

  <xsl:template match="menu[position()=1]">
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="menu">
     <!-- Encode label to escape any reserved characters such as space -->
     <xsl:variable name="encLabel" select="NetUtils:encodePath(string(@label))"/>
     <tr>
      <td valign="top" bgcolor="#959595" background="images/label-background_b.gif">
       <img src="images/separator.gif"/><br/>
       <span class="menutitle"><xsl:value-of select="@label"/></span></td>
     </tr>
     <xsl:apply-templates/>
  </xsl:template>


  <xsl:template match="menu-item">
    <xsl:if test="not(@type) or @type!='hidden'">
     <xsl:variable name="encLabel" select="NetUtils:encodePath(string(@label))"/>
     <tr>
      <td bgcolor="#959595" valign="top">
       <xsl:attribute name="background">images/label-background_a.gif</xsl:attribute>
       <xsl:choose>
         <xsl:when test="contains(@href, $resource)">
           <span class="menuselected"><xsl:value-of select="@label"/></span>
         </xsl:when>
         <xsl:otherwise>
           <a href="{@href}" class="menu"><xsl:value-of select="@label"/></a>
         </xsl:otherwise>
       </xsl:choose>
      </td>
     </tr>
    </xsl:if>
  </xsl:template>

  <xsl:template match="external">
    <xsl:if test="not(@type) or @type!='hidden'">
     <xsl:variable name="encLabel" select="NetUtils:encodePath(string(@label))"/>
     <tr><td bgcolor="#959595" background="images/label-background_a.gif" valign="top">
        <a href="{@href}" target="new" class="menu"><xsl:value-of select="@label"/></a>
        </td>
     </tr>
    </xsl:if>
  </xsl:template>

  <xsl:template match="node()|@*" priority="-1"/>
</xsl:stylesheet>


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

Reply via email to