cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yves Vindevogel <yves.vindevo...@implements.be>
Subject Re: Problem with XSL document() function when trying to get content of OpenOffice document within Cocoon
Date Fri, 09 May 2003 21:27:21 GMT
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


Mime
View raw message