You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Yves Vindevogel <yv...@implements.be> on 2003/05/09 22:05:18 UTC
Re: Problem with XSL document() function when trying to get
content of OpenOffice document within Cocoon
Hi Jörg,
I think the jar:http was necesarry for the jar-protocol. I forgot why I
needed this, but it was something like that. I should recollect my docs
from that pipeline experiment. Anyway, I retested with the jar:cocoon
line, and indeed, it does not work (with the url in the browser), so I
think I was right that there were problems in combination with the jar
... (anyone can confirm ?)
Anyway, I also adapted my code to the cocoon:// in the XSL, and that
does not work either. I don't see a reason why it should give me a file
not found exception, since it really exists from the url ... I also
tested this by saving the file to xml, and I have the same problem. It
will not read from the OO file, whether in zip or in xml pure.
On Fri, 2003-05-09 at 21:46, Joerg Heinicke wrote:
> Hello Yves,
>
> I can see no real mistake in your sitemap snippets or the XSL. But as
> far as I know with the standard Xalan a FileNotFoundException or similar
> is thrown when a resource can't be accessed. So you should find a hint
> in the log files.
>
> Another point: Using http protocol is really a bad choice when making
> sitemap internal subrequests. Much better is the cocoon protocol:
>
> > <map:match pattern="sxw/*.content.xml">
> > <map:generate src="jar:cocoon:/sxw/{1}.sxw!/content.xml"/>
> > <map:serialize type="xml"/>
> > </map:match>
>
> > <xsl:when test="source">
> > <xsl:copy-of select="document('cocoon:/test.xml')"/>
> > <xsl:copy-of select="document('cocoon:/sxw/homepage.content.xml')"/>
> > </xsl:when>
>
> Otherwise the request goes outside of Cocoon to the servlet container!
>
> If you only do <xsl:copy-of select="$OOdocument"/> you don't need the
> OpenOffice namespaces in the XSLT.
>
> Regards,
>
> Joerg
>
> Yves Vindevogel wrote:
> > Hi all,
> >
> > I'm having a problem with the XSL document() function.
> >
> > This is my sitemap (fragment)
> > <map:match pattern="test.xml">
> > <map:read src="content/home/home.xml"/>
> > </map:match>
> >
> > <map:match pattern="sxw/*.sxw">
> > <!-- needed for OpenOffice generator -->
> > <map:read src="sxw/{1}.sxw" mime-type="application/zip"/>
> > </map:match>
> >
> > <map:match pattern="sxw/*.content.xml">
> > <map:generate src="jar:http://localhost/implements/sxw/{1}.sxw!/content.xml"/>
> > <map:serialize type="xml"/>
> > </map:match>
> >
> > This fragment is okay. When I type the URL
> > http://localhost/implements/sxw/homepage.content.xml, I get the
> > content.xml of the file in XML. This all works, I even posted that in
> > the wiki some time ago.
> >
> > Now, I have a XSL document with this code:
> > <xsl:when test="source">
> > <xsl:copy-of select="document('http://localhost/implements/test.xml')"/>
> > <xsl:copy-of select="document('http://localhost/implements/sxw/homepage.content.xml')"/>
> > </xsl:when>
> >
> > When I run this, the relavant output is this
> >
> > <xml>
> > <document img="welcome" alt="Welcome to Implements">
> > <title>Welcome to Implements</title>
> > <source type="oowriter" src="homepage"/>
> > </document>
> > </xml>
> >
> > Now, that's only the content of my first test.xml document.
> > The document() function refuses to read within my OpenOffice document.
> > I have no clue why, because the test.xml file, is not a real file either, it's created through a pipeline.
> > I can type the openoffice link in the url of my browser, it exists, xml is valid (I think) in it.
> >
> > I have included all the namespaces on top of my XSL for OpenOffice, so I think it can't be that either.
> >
> >
> > Anyone who has a clue why this happens or how I could resolve it ?
> >
> > Regards,
> > Yves
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org