You're right, I can get the document through cocoon:/ (thankz to clear that
up, Marc;-), but when I use Jetty instead of Tomcat I still get an error

FATAL_E (2004-01-05) 16:20.52:224   [core.xslt-processor]
(/cocoontest/index.html) PoolThread-4/TraxErrorHandler: Error in
TraxTransformer: file:/d:/cocoontest/stylesheets/wdc2html.xsl; Line 101;
Column 40;
; SystemID: file:/d:/cocoontest/stylesheets/wdc2html.xsl; Line#: 101;
Column#: 40
javax.xml.transform.TransformerException: Unknown error in XPath.
at org.apache.xpath.XPath.bool(XPath.java:410)
 at org.apache.xalan.templates.ElemIf.execute(ElemIf.java:197)
...

 <xsl:variable name="LookUp"
select="document('cocoon:/Resource/LookUp.xml')/LookUp"/>

<xsl:template match="Navigation">
      <xsl:if test="descendant::Navigate">
          <xsl:call-template name="NavigationCycle">
              <xsl:with-param name="navigate">
                 <xsl:value-of select="descendant::Navigate"/>
              </xsl:with-param>
            <xsl:with-param name="current-context">
                <xsl:value-of select="$LookUp"/>
           </xsl:with-param>
       </xsl:call-template>
    </xsl:if>
 </xsl:template>

<xsl:template name="NavigationCycle">
  <xsl:param name="navigate"/>
  <xsl:param name="current-context"/>
101-->>  <xsl:if test="$current-context/Item">        Crashes here
                   <xsl:for-each select="$current-context/Item">
...
</xsl:template>

I don't know why Jetty gives this error while Tomcat doesn't.
Hmm, maybe it's time to clean up and rebuild all the cocoon stuff and
retry...

Greetz,

 Jan


----- Original Message ----- 
From: "Marc Portier" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 05, 2004 3:32 PM
Subject: Re: Jetty and XSLT with document()


>
>
> Jan Hoskens wrote:
> > Hi,
> >
> > You mean to use that in the sitemap? The document() is in the stylesheet
> > so the cocoon protocols do not apply there (or do they???).
>
> surprise surprise: they do.
>
> > If I try to
> > resolve the path in the sitemap, there has to be a matching pipeline and
> > the result will be a xml fragment. I tried to pass a documentpiece as
> > parameter (as a quick tryout) but that didn't seem to work. Is it
> > possible to do that? Passing a document fragment from the sitemap to the
> > stylesheet?
> >
>
> Nope,
> David means you can just use that inside your xsl document() as well.
>
> Would need to check in detail, but what happens is roughly this:
>
> - cocoon creates the XSLT transformer, and through avalon's lifecycle
> that one can get a hold of the cocoon environment's source resolver (the
> same one used inside the sitemap indeed)
>
> - now, inside that transformer you can expect some
> javax.xml.transform.Transformer to be created, upon which we can safely
> register a custom URIResolver
>
> see also:
>
http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/transform/Transformer.html#setURIResolver(javax.xml.transform.URIResolver)
>
> so, that one gets used for resolving the URI-String inside the
> document() function
>
>
> hope this clears up the mystery?
>
> -marc=
>
> > Greetz,
> >
> > Jan
> >
> >     ----- Original Message -----
> >     *From:* Carmona Perez, David <mailto:[EMAIL PROTECTED]>
> >     *To:* [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> >     *Sent:* Monday, January 05, 2004 3:02 PM
> >     *Subject:* RE: Jetty and XSLT with document()
> >
> >     As a workaround to the problem, why don’t try to use another
> >     protocol like:
> >
> >       context:/myPath/myFile.xml or cocoon:/url
> >
> >     ?
> >
> >     /--------/
> >
> >     /David/
> >
> >
> >
> >     -----Mensaje original-----
> >     *De:* Jan Hoskens [mailto:[EMAIL PROTECTED]
> >     *Enviado el:* lunes, 05 de enero de 2004 14:53
> >     *Para:* [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> >     *Asunto:* Jetty and XSLT with document()
> >
> >
> >
> >     Hi,
> >
> >
> >
> >     I'm using a stylesheet with a variable that contains a nodeset
variable:
> >
> >
> >
> >     <xsl:variable name="Lookup"
> >     select="document('../resources/Lookup.xml')/Lookup"/>
> >
> >
> >
> >     The path in the document() function is relative and does work under
> >     Tomcat.
> >
> >     If I switch to jetty, an exception occurs when I want to use the
> >     variable as a nodeset:
> >
> >
> >
> >     <xsl:if test="$Lookup/Item">
> >
> >
> >
> >     FATAL_E (2004-01-05) 13:48.36:637   [core.xslt-processor]
> >     (/cocoontest/index.html) PoolThread-4/TraxErrorHandler: Error in
> >     TraxTransformer: file:/d:/cocoontest/stylesheets/wdc2html.xsl; Line
> >     101; Column 54;
> >     ; SystemID: file:/d:/cocoontest/stylesheets/wdc2html.xsl; Line#:
> >     101; Column#: 54
> >     javax.xml.transform.TransformerException:
java.lang.ClassCastException
> >
> >
> >
> >     It seems that under Jetty, the variable does not contain the xml
> >     document at all and gives an exception because the test expects a
> >     nodeset but does not receive one?
> >
> >
> >
> >     Why doesn't Jetty give me the document as Tomcat does??
> >
> >     Or is it wrong to use paths relative to the xsl document in the xsl
> >     itself?
> >
> >
> >
> >
> >
> >     Thankzz,
> >
> >
> >
> >     Jan
> >
> >
> >
> >
> >
>
> -- 
> Marc Portier                            http://outerthought.org/
> Outerthought - Open Source, Java & XML Competence Support Center
> Read my weblog at                http://blogs.cocoondev.org/mpo/
> [EMAIL PROTECTED]                              [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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

Reply via email to