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 21:15:15 UTC

Problem with XSL document() function when trying to get content of OpenOffice document within Cocoon

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


Re: Problem with XSL document() function when trying to get content of OpenOffice document within Cocoon

Posted by Yves Vindevogel <yv...@implements.be>.
Hi all, again,

I got one step closer to a solution.
When I saved the sxw/homepage.content.xml file, I saw that it included
two lines on top: the <?xml version> processing instruction, and the
<!DOCTYPE> line.  I manually removed them from that file, and retested
my code, based on the file (with a <map:read> instead of a
<map:generate>)

This works, the document() function now extracts the document into my
output.

Now, next question, how can I prevent the <?xml> and <!DOCTYPE> to be
send to the pipeline ??  

The pipeline responsible for the output is this one:
<map:match pattern="sxw/*.content.xml">
   <map:generate src="jar:http://localhost/implements/sxw/{1}.sxw!/content.xml"/>
   <map:serialize type="xml"/>
 </map:match>
 


> 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


Re: Problem with XSL document() function when trying to get content of OpenOffice document within Cocoon

Posted by Yves Vindevogel <yv...@implements.be>.
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


Re: Problem with XSL document() function when trying to get content of OpenOffice document within Cocoon

Posted by Joerg Heinicke <jo...@gmx.de>.
>>But there is still code in it like the following:
>>
>>     <xsl:for-each select="node()">
>>       <xsl:choose>
>>         <xsl:when test="name()=' '">
>>           <xsl:value-of select="."/>
>>         </xsl:when>
>>         <xsl:otherwise>
>>           <xsl:apply-templates select="."/>
>>         </xsl:otherwise>
>>       </xsl:choose>
>>     </xsl:for-each>
>>
>>For which type of nodes the <xsl:when/> test returns true? No node() 
>>should return a single space as name(). Or am I false?
>>
> 
> I think that was for the pure texts somewhere.  I may have found them
> somewhere. It could be that it isn't used anymore, but I'm not sure. 
> I'm using this stylesheet for the moment, I will take a closer look at
> it and let you know.

<xsl:when test="self::text()">

:-)

Joerg


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Problem with XSL document() function when trying to get content of OpenOffice document within Cocoon

Posted by Yves Vindevogel <yv...@implements.be>.
Reply in mail

On Sat, 2003-05-10 at 00:55, Joerg Heinicke wrote:

> 2. DTD: Didn't it work when using catalog's?
> 

No, it's definitely in the catalogs.  I need it for the normal
extraction of the zipfiles into a usuable document for my website.  See
my wiki page where I describe the procedure I use.  I added the
catalogs.

> 3. I wonder why your solution works. It's a parser issue. But the file 
> must be parsed both when using fuckdoc.xsl and using it not. Really strange.
> 
Developers ?  Bug ?

> 4. shortening fuckdoc.xsl:
> 
Yes, I need to do a code cleanup.  But in the middle of testing, there's
a lot of cut & waste.

> 6. I fixed the styling of your wiki page 
> (http://wiki.cocoondev.org/Wiki.jsp?page=OpenOfficeGeneration). You only 
> used {{, but it has to be {{{ to style it as <pre/>.
> 
No problem.  It was my first page on the wiki.  I didn't go through all
the stuff back then.  I was already happy to have posted  ;-))

> 7. I changed a bit in the XSLT, refactoring and simplifying is one of my 
> favourite works ;-) I hope you don't object it.
No, I don't mind, it's open source ;-)

> Have a look at the template matching text:h. Furthermore I used 
> Attribute Value Templates {expression} instead of xsl:attribute where it 
> was meaningful.

Yes, I use that too now.  Back then I like writing a lot of code  ;-))
> 
> But there is still code in it like the following:
> 
>      <xsl:for-each select="node()">
>        <xsl:choose>
>          <xsl:when test="name()=' '">
>            <xsl:value-of select="."/>
>          </xsl:when>
>          <xsl:otherwise>
>            <xsl:apply-templates select="."/>
>          </xsl:otherwise>
>        </xsl:choose>
>      </xsl:for-each>
> 
> For which type of nodes the <xsl:when/> test returns true? No node() 
> should return a single space as name(). Or am I false?
> 
I think that was for the pure texts somewhere.  I may have found them
somewhere. It could be that it isn't used anymore, but I'm not sure. 
I'm using this stylesheet for the moment, I will take a closer look at
it and let you know.

> 
> Yves Vindevogel wrote:
> > Ha! I found the reason for this: it's the doctype that's included in the
> > xml file.  I tried to get rid of it, but doesn't work.  The office.dtd
> > is included in the resources (see wiki for explanation why this is
> > needed), but no help.  
> > 
> > I rewrote my OpenOffice pipeline a bit to this:
> > 			<map:match pattern="sxw/*.content.xml">
> > 				<map:generate
> > src="jar:http://localhost/implements/sxw/{1}.sxw!/content.xml"/>
> > 				<map:transform src="xsl/fuckdoc.xsl"/>
> > 				<map:serialize type="xml"/>
> > 			</map:match>
> > 
> > 
> > The extra xsl is below, and it gives me the original file, without
> > doctype, and then, my code works ....
> > 
> > It may not be too elegant (neither is the naming of the xsl file), but
> > for now, it's a reasonable workaround.  
> > 
> > If anybody knows a more elegant way, please inform me
> > 
> > Thanks all.
> > 
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> > <xsl:stylesheet version="1.0"
> > 
> > 	<xsl:template match="/">
> > 		<xsl:copy-of select="."/>
> > 	</xsl:template>
> > 
> >         <xsl:template match="text()"/>
> > </xsl:stylesheet>
> 
> 
> ---------------------------------------------------------------------
> 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


Re: Problem with XSL document() function when trying to get content of OpenOffice document within Cocoon

Posted by Joerg Heinicke <jo...@gmx.de>.
1. jar:cocoon: I didn't know that, but I found at Wiki:
"This sitemap is intended to be mounted as /jar-test - it uses http to 
access the zip file. This is because the jar: protocol is not aware of 
the cocoon: protocol. An alternative would be to access the jar file 
with the file: protocol, which would involve specifying a complete file 
path name."
But you can use cocoon:// still in the XSLT.

2. DTD: Didn't it work when using catalog's?

3. I wonder why your solution works. It's a parser issue. But the file 
must be parsed both when using fuckdoc.xsl and using it not. Really strange.

4. shortening fuckdoc.xsl:

<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

   <xsl:template match="/">
     <xsl:copy-of select="."/>
   </xsl:template>

</xsl:stylesheet>

5. nice joke ;-)

6. I fixed the styling of your wiki page 
(http://wiki.cocoondev.org/Wiki.jsp?page=OpenOfficeGeneration). You only 
used {{, but it has to be {{{ to style it as <pre/>.

7. I changed a bit in the XSLT, refactoring and simplifying is one of my 
favourite works ;-) I hope you don't object it.
Have a look at the template matching text:h. Furthermore I used 
Attribute Value Templates {expression} instead of xsl:attribute where it 
was meaningful.

But there is still code in it like the following:

     <xsl:for-each select="node()">
       <xsl:choose>
         <xsl:when test="name()=' '">
           <xsl:value-of select="."/>
         </xsl:when>
         <xsl:otherwise>
           <xsl:apply-templates select="."/>
         </xsl:otherwise>
       </xsl:choose>
     </xsl:for-each>

For which type of nodes the <xsl:when/> test returns true? No node() 
should return a single space as name(). Or am I false?

Regards,

Joerg

Yves Vindevogel wrote:
> Ha! I found the reason for this: it's the doctype that's included in the
> xml file.  I tried to get rid of it, but doesn't work.  The office.dtd
> is included in the resources (see wiki for explanation why this is
> needed), but no help.  
> 
> I rewrote my OpenOffice pipeline a bit to this:
> 			<map:match pattern="sxw/*.content.xml">
> 				<map:generate
> src="jar:http://localhost/implements/sxw/{1}.sxw!/content.xml"/>
> 				<map:transform src="xsl/fuckdoc.xsl"/>
> 				<map:serialize type="xml"/>
> 			</map:match>
> 
> 
> The extra xsl is below, and it gives me the original file, without
> doctype, and then, my code works ....
> 
> It may not be too elegant (neither is the naming of the xsl file), but
> for now, it's a reasonable workaround.  
> 
> If anybody knows a more elegant way, please inform me
> 
> Thanks all.
> 
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xsl:stylesheet version="1.0"
> 	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> 	xmlns:office="http://openoffice.org/2000/office"
> 	xmlns:style="http://openoffice.org/2000/style"
> 	xmlns:text="http://openoffice.org/2000/text"
> 	xmlns:table="http://openoffice.org/2000/table"
> 	xmlns:draw="http://openoffice.org/2000/drawing"
> 	xmlns:fo="http://www.w3.org/1999/XSL/Format"
> 	xmlns:xlink="http://www.w3.org/1999/xlink"
> 	xmlns:number="http://openoffice.org/2000/datastyle"
> 	xmlns:svg="http://www.w3.org/2000/svg"
> 	xmlns:chart="http://openoffice.org/2000/chart"
> 	xmlns:dr3d="http://openoffice.org/2000/dr3d"
> 	xmlns:math="http://www.w3.org/1998/Math/MathML"
> 	xmlns:form="http://openoffice.org/2000/form"
> 	xmlns:script="http://openoffice.org/2000/script"
> 	xmlns:config="http://openoffice.org/2001/config"
> 	xmlns:meta="http://openoffice.org/2000/meta"
> 	xmlns:manifest="http://openoffice.org/2001/manifest"
> 	xmlns:dc="http://purl.org/dc/elements/1.1/">
> 
> 	<xsl:template match="/">
> 		<xsl:copy-of select="."/>
> 	</xsl:template>
> 
>         <xsl:template match="text()"/>
> </xsl:stylesheet>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Problem with XSL document() function when trying to get content of OpenOffice document within Cocoon

Posted by Yves Vindevogel <yv...@implements.be>.
Ha! I found the reason for this: it's the doctype that's included in the
xml file.  I tried to get rid of it, but doesn't work.  The office.dtd
is included in the resources (see wiki for explanation why this is
needed), but no help.  

I rewrote my OpenOffice pipeline a bit to this:
			<map:match pattern="sxw/*.content.xml">
				<map:generate
src="jar:http://localhost/implements/sxw/{1}.sxw!/content.xml"/>
				<map:transform src="xsl/fuckdoc.xsl"/>
				<map:serialize type="xml"/>
			</map:match>


The extra xsl is below, and it gives me the original file, without
doctype, and then, my code works ....

It may not be too elegant (neither is the naming of the xsl file), but
for now, it's a reasonable workaround.  

If anybody knows a more elegant way, please inform me

Thanks all.

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:office="http://openoffice.org/2000/office"
	xmlns:style="http://openoffice.org/2000/style"
	xmlns:text="http://openoffice.org/2000/text"
	xmlns:table="http://openoffice.org/2000/table"
	xmlns:draw="http://openoffice.org/2000/drawing"
	xmlns:fo="http://www.w3.org/1999/XSL/Format"
	xmlns:xlink="http://www.w3.org/1999/xlink"
	xmlns:number="http://openoffice.org/2000/datastyle"
	xmlns:svg="http://www.w3.org/2000/svg"
	xmlns:chart="http://openoffice.org/2000/chart"
	xmlns:dr3d="http://openoffice.org/2000/dr3d"
	xmlns:math="http://www.w3.org/1998/Math/MathML"
	xmlns:form="http://openoffice.org/2000/form"
	xmlns:script="http://openoffice.org/2000/script"
	xmlns:config="http://openoffice.org/2001/config"
	xmlns:meta="http://openoffice.org/2000/meta"
	xmlns:manifest="http://openoffice.org/2001/manifest"
	xmlns:dc="http://purl.org/dc/elements/1.1/">

	<xsl:template match="/">
		<xsl:copy-of select="."/>
	</xsl:template>

        <xsl:template match="text()"/>
</xsl:stylesheet>


> 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


Re: Problem with XSL document() function when trying to get content of OpenOffice document within Cocoon

Posted by Joerg Heinicke <jo...@gmx.de>.
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