You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Zamek <za...@vili.pmmf.hu> on 2004/02/02 11:45:33 UTC
Openoffice generator
Hi All,
Are there anybody out there, who is working with Openoffice generator in
Cocoon?
I tried to setup it based on Yves Vindevogel's wiki document, but I get an
empty document:
--------------------------------------
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<!--The CSS style header method for setting styles-->
<style type="text/css">
<!--
BODY { background-repeat: no-repeat }
*.OOo_defaults {
margin-top:0cm; margin-bottom:0cm; }
//-->
</style>
</head>
<body></body>
</html>
--------------------------------------
and when I try to read content.xml from sxw via cocoon
(http://localhost:8888/mount/oo/sxw/123.sxw!/content.xml) I get this empty
result:
<html><body></body></html>
It seems to be cocoon cannot get a valid content.xml or "somebody" convert
it.
My sitemap.xmap is:
----------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!-- CVS $Id: sitemap.xmap,v 1.15 2003/09/07 06:16:41 vgritsenko Exp $
--><map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
<map:pipelines>
<map:pipeline>
<map:match pattern="sxw/*.html">
<map:aggregate element="office:document">
<map:part
src="jar:http://localhost:8888/mount/oo/sxw/{1}.sxw!/content.xml"/>
<map:part src="jar:http://localhost:8888/mount/oo/sxw/{1}.sxw!/meta.xml"/>
<!-- additional for styles -->
<map:part
src="jar:http://localhost:8888/mount/oo/sxw/{1}.sxw!/styles.xml"/>
</map:aggregate>
<!-- for using the standard OO transformation -->
<map:transform src="xsl/main_html.xsl">
<map:parameter name="metaFileURL"
value="http://localhost:8888/mount/oo/sxw/{1}/meta.xml"/>
<map:parameter name="stylesFileURL"
value="http://localhost:8888/mount/oo/sxw/{1}/styles.xml"/>
<map:parameter name="absoluteSourceDirRef"
value="http://localhost:8888/mount/oo/sxw/{1}.sxw"/>
<map:parameter name="jaredRootURL"
value="http://localhost:8888/mount/oo/sxw/{1}"/>
</map:transform>
<!-- Uncomment this, and comment previous if you want to use
html.oowriter.xsl instead of standard OO transformation
<map:transform src="xsl/html.oowriter.xsl"/> -->
<map:serialize type="html"/>
</map:match>
<map:match pattern="*.sxw">
<map:read src="{1}.sxw" mime-type="application/zip"/>
</map:match>
<!-- additional for xml reading -->
<map:match pattern="sxw/*/**.xml">
<map:read src="jar:http://localhost:8888/mount/oo/sxw/{1}.sxw!/{2}.xml"
mime-type="text/plain"/>
<map:serialize type="xml"/>
</map:match>
<!-- additional for images -->
<map:match pattern="sxw/*/Pictures/*.png">
<map:read
src="jar:http://localhost:8888/mount/oo/sxw/{1}.sxw!/Pictures/{2}.png"
mime-type="image/png"/>
</map:match>
<map:match pattern="sxw/*.sxw">
<map:read src="sxw/{1}.sxw" mime-type="application/zip"/>
</map:match>
</map:pipeline>
</map:pipelines>
</map:sitemap>
----------------------------------------------------
My environment:
Debian GNU Linux 3.0
java 1.4 from sun,
Cocoon 2.1.3
and Openoffice.org 1.1.0 hungary language
--
many thanks,
Zoltan Zidarics programmer
PTE University Pecs, Hungary
icq: 43288694
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Openoffice generator
Posted by Zamek <za...@vili.pmmf.hu>.
Hello,
Yessss! It works fine! Many thanks to you!
On Tuesday 03 February 2004 13.47, Upayavira wrote:
> So you need to pass the name of the document from the sitemap to the
> XSLT:
>
> <map:match pattern="*.xsw">
> ...
> <map:transform src="ooo2html.xsl">
> <map:parameter name="doc_name" value="{1}"/>
> </map:transform>
> ...
> </map:match>
>
> Then in oo2html.xsl:
> <xsl:stylesheet .......>
> <xsl:param name="doc_name"/>
> ...
> <xsl:template match=.......>
>
> <img src="{$doc_name}/{substring-after(@xlink:href,'#Pictures/')}/>
>
>
> Regards, Upayavira
--
udv,
Zoltan Zidarics programmer
PTE University Pecs, Hungary
icq: 43288694
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Openoffice generator
Posted by Upayavira <uv...@upaya.co.uk>.
Zamek wrote:
>Hello,
>
>On Tuesday 03 February 2004 12.59, Upayavira wrote:
>
>
>>Zamek wrote:
>>
>>
>>>On Tuesday 03 February 2004 10.33, Upayavira wrote:
>>>
>>>
>>>>Zamek wrote:
>>>>
>>>>
>>>>>How can I translate #Pictures/nnn.png to document_name/nnn.png in xsl?
>>>>>
>>>>>
>>>><img src="document_name/{substring-after(@xlink:href,'#Pictures/')}/>
>>>>
>>>>
>>>As you can see I am not an xml expert :-(
>>>
>>>Its result is:
>>><img src="document_name/10000000000002F40000022DB4BA1A68.png"
>>>alt="Graphic1">
>>>
>>>xsl template is:
>>>
>>><xsl:template match="//draw:image">
>>> <img alt="{@draw:name}"
>>>src="document_name/{substring-after(@xlink:href,'#Pictures/')}"/>
>>></xsl:template>
>>>
>>>It is closed to successfully, it need to retrive name of document only.
>>>
>>>
>>Sorry, I don't understand. It seems that the code has done what I
>>intended. What are you trying to achieve instead?
>>
>>
>
>For example I have an oo document named voiceip.sxw. I has a lot of image in
>it. Image refrences is like #Pictures/nnnnnnn.png are relative links inside
>this document.
>
>I can get images in my sitemap.xmap like:
>
> <map:match pattern="*/*.png">
> <map:read src="zip://Pictures/{2}.png@{1}" mime-type="image/png"/>
> </map:match>
>
>in ooo2html.xsl template need to be convert images to this format.
>
>At this example: voiceip.sxw/nnnnnn.png
>
>Original tempalte cannot retrive pictures:
>
><xsl:template match="//draw:image">
> <img alt="{@draw:name}" src="{@xlink:href}" />
></xsl:template>
>
>because its result is #Pictures/nnnnnnnn.png
>
>your templates seems to be good, but it cannot retrieve name of document.
>
>Your template's result is document_name/nnnnnnn.png instead of
>voiceip.sxw/nnnnnnnnn.png.
>
>
>
So you need to pass the name of the document from the sitemap to the XSLT:
<map:match pattern="*.xsw">
...
<map:transform src="ooo2html.xsl">
<map:parameter name="doc_name" value="{1}"/>
</map:transform>
...
</map:match>
Then in oo2html.xsl:
<xsl:stylesheet .......>
<xsl:param name="doc_name"/>
...
<xsl:template match=.......>
<img src="{$doc_name}/{substring-after(@xlink:href,'#Pictures/')}/>
Regards, Upayavira
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Openoffice generator
Posted by Zamek <za...@vili.pmmf.hu>.
Hello,
On Tuesday 03 February 2004 12.59, Upayavira wrote:
> Zamek wrote:
> >On Tuesday 03 February 2004 10.33, Upayavira wrote:
> >>Zamek wrote:
> >>>How can I translate #Pictures/nnn.png to document_name/nnn.png in xsl?
> >>
> >><img src="document_name/{substring-after(@xlink:href,'#Pictures/')}/>
> >
> >As you can see I am not an xml expert :-(
> >
> >Its result is:
> ><img src="document_name/10000000000002F40000022DB4BA1A68.png"
> >alt="Graphic1">
> >
> >xsl template is:
> >
> ><xsl:template match="//draw:image">
> > <img alt="{@draw:name}"
> >src="document_name/{substring-after(@xlink:href,'#Pictures/')}"/>
> ></xsl:template>
> >
> >It is closed to successfully, it need to retrive name of document only.
>
> Sorry, I don't understand. It seems that the code has done what I
> intended. What are you trying to achieve instead?
For example I have an oo document named voiceip.sxw. I has a lot of image in
it. Image refrences is like #Pictures/nnnnnnn.png are relative links inside
this document.
I can get images in my sitemap.xmap like:
<map:match pattern="*/*.png">
<map:read src="zip://Pictures/{2}.png@{1}" mime-type="image/png"/>
</map:match>
in ooo2html.xsl template need to be convert images to this format.
At this example: voiceip.sxw/nnnnnn.png
Original tempalte cannot retrive pictures:
<xsl:template match="//draw:image">
<img alt="{@draw:name}" src="{@xlink:href}" />
</xsl:template>
because its result is #Pictures/nnnnnnnn.png
your templates seems to be good, but it cannot retrieve name of document.
Your template's result is document_name/nnnnnnn.png instead of
voiceip.sxw/nnnnnnnnn.png.
--
thank you very well,
Zoltan Zidarics programmer
PTE University Pecs, Hungary
icq: 43288694
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Openoffice generator
Posted by Upayavira <uv...@upaya.co.uk>.
Zamek wrote:
>On Tuesday 03 February 2004 10.33, Upayavira wrote:
>
>
>>Zamek wrote:
>>
>>
>>>How can I translate #Pictures/nnn.png to document_name/nnn.png in xsl?
>>>
>>>
>><img src="document_name/{substring-after(@xlink:href,'#Pictures/')}/>
>>
>>
>As you can see I am not an xml expert :-(
>
>Its result is:
><img src="document_name/10000000000002F40000022DB4BA1A68.png"
>alt="Graphic1">
>
>xsl template is:
>
><xsl:template match="//draw:image">
> <img alt="{@draw:name}"
>src="document_name/{substring-after(@xlink:href,'#Pictures/')}"/>
></xsl:template>
>
>It is closed to successfully, it need to retrive name of document only.
>
>
Sorry, I don't understand. It seems that the code has done what I
intended. What are you trying to achieve instead?
Upayavira
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Openoffice generator
Posted by Zamek <za...@vili.pmmf.hu>.
On Tuesday 03 February 2004 10.33, Upayavira wrote:
> Zamek wrote:
> >How can I translate #Pictures/nnn.png to document_name/nnn.png in xsl?
>
> <img src="document_name/{substring-after(@xlink:href,'#Pictures/')}/>
As you can see I am not an xml expert :-(
Its result is:
<img src="document_name/10000000000002F40000022DB4BA1A68.png"
alt="Graphic1">
xsl template is:
<xsl:template match="//draw:image">
<img alt="{@draw:name}"
src="document_name/{substring-after(@xlink:href,'#Pictures/')}"/>
</xsl:template>
It is closed to successfully, it need to retrive name of document only.
--
thank you,
Zoltan Zidarics programmer
PTE University Pecs, Hungary
icq: 43288694
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Openoffice generator
Posted by Upayavira <uv...@upaya.co.uk>.
Zamek wrote:
>Hello,
>
>On Monday 02 February 2004 13.02, Reinhard Poetz wrote:
>
>
>>Have a look at the scratchpad (CVS or wait for 2.1.4). You'll find some
>>ZIP-Source samples and one is an Openoffice.org one.
>>
>>
>
>It is a good idea, and works well, but :-)
>
>If my Openoffice document has some images I cannot retrieve it, because
>reference of images is #Pictures/nnnn.png
>
>I am using ooo2html.xsl from Zope. It handles pictures like:
>
><xsl:template match="//draw:image">
> <img alt="{@draw:name}" src="{@xlink:href}" />
></xsl:template>
>
>@xlink:href value is #Pictures/nnn.png, but it is only a relative link,
>instead of absolute which is containing document name.
>
>The protocol is zip://Pictures/{2}.png@{1}.sxw
>
>How can I translate #Pictures/nnn.png to document_name/nnn.png in xsl?
>
>
<img src="document_name/{substring-after(@xlink:href,'#Pictures/')}/>
Regards, Upayavira
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Openoffice generator
Posted by Zamek <za...@vili.pmmf.hu>.
Hello,
On Monday 02 February 2004 13.02, Reinhard Poetz wrote:
> Have a look at the scratchpad (CVS or wait for 2.1.4). You'll find some
> ZIP-Source samples and one is an Openoffice.org one.
It is a good idea, and works well, but :-)
If my Openoffice document has some images I cannot retrieve it, because
reference of images is #Pictures/nnnn.png
I am using ooo2html.xsl from Zope. It handles pictures like:
<xsl:template match="//draw:image">
<img alt="{@draw:name}" src="{@xlink:href}" />
</xsl:template>
@xlink:href value is #Pictures/nnn.png, but it is only a relative link,
instead of absolute which is containing document name.
The protocol is zip://Pictures/{2}.png@{1}.sxw
How can I translate #Pictures/nnn.png to document_name/nnn.png in xsl?
--
thx,
Zoltan Zidarics programmer
PTE University Pecs, Hungary
icq: 43288694
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
RE: Openoffice generator
Posted by Reinhard Poetz <re...@apache.org>.
Have a look at the scratchpad (CVS or wait for 2.1.4). You'll find some
ZIP-Source samples and one is an Openoffice.org one.
--
Reinhard
> -----Original Message-----
> From: Zamek [mailto:zamek@vili.pmmf.hu]
> Sent: Monday, February 02, 2004 11:46 AM
> To: users@cocoon.apache.org
> Subject: Openoffice generator
>
>
> Hi All,
>
> Are there anybody out there, who is working with Openoffice
> generator in
> Cocoon?
>
> I tried to setup it based on Yves Vindevogel's wiki document,
> but I get an
> empty document:
> --------------------------------------
> <html>
> <head>
> <META http-equiv="Content-Type" content="text/html;
> charset=ISO-8859-1"> <!--The CSS style header method for
> setting styles--> <style type="text/css">
> <!--
> BODY { background-repeat: no-repeat }
> *.OOo_defaults {
> margin-top:0cm; margin-bottom:0cm; }
>
> //-->
> </style>
> </head>
> <body></body>
> </html>
> --------------------------------------
>
> and when I try to read content.xml from sxw via cocoon
> (http://localhost:8888/mount/oo/sxw/123.sxw!/content.xml) I
> get this empty
> result:
> <html><body></body></html>
>
> It seems to be cocoon cannot get a valid content.xml or
> "somebody" convert
> it.
>
> My sitemap.xmap is:
> ----------------------------------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <!-- CVS $Id: sitemap.xmap,v 1.15 2003/09/07 06:16:41
> vgritsenko Exp $
> --><map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
>
> <map:pipelines>
> <map:pipeline>
>
> <map:match pattern="sxw/*.html">
> <map:aggregate element="office:document">
> <map:part
> src="jar:http://localhost:8888/mount/oo/sxw/{1}.sxw!/content.xml"/>
> <map:part
> src="jar:http://localhost:8888/mount/oo/sxw/{1}.sxw!/meta.xml"/>
> <!-- additional for styles -->
> <map:part
> src="jar:http://localhost:8888/mount/oo/sxw/{1}.sxw!/styles.xml"/>
>
> </map:aggregate>
>
> <!-- for using the standard OO transformation -->
> <map:transform src="xsl/main_html.xsl">
> <map:parameter name="metaFileURL"
> value="http://localhost:8888/mount/oo/sxw/{1}/meta.xml"/>
> <map:parameter name="stylesFileURL"
> value="http://localhost:8888/mount/oo/sxw/{1}/styles.xml"/>
> <map:parameter name="absoluteSourceDirRef"
> value="http://localhost:8888/mount/oo/sxw/{1}.sxw"/>
> <map:parameter name="jaredRootURL"
> value="http://localhost:8888/mount/oo/sxw/{1}"/>
> </map:transform>
>
> <!-- Uncomment this, and comment previous if you
> want to use
> html.oowriter.xsl instead of standard OO transformation
> <map:transform src="xsl/html.oowriter.xsl"/> -->
>
> <map:serialize type="html"/>
> </map:match>
>
> <map:match pattern="*.sxw">
> <map:read src="{1}.sxw" mime-type="application/zip"/>
> </map:match>
>
> <!-- additional for xml reading -->
> <map:match pattern="sxw/*/**.xml">
> <map:read
> src="jar:http://localhost:8888/mount/oo/sxw/{1}.sxw!/{2}.xml"
> mime-type="text/plain"/>
> <map:serialize type="xml"/>
> </map:match>
>
> <!-- additional for images -->
> <map:match pattern="sxw/*/Pictures/*.png">
> <map:read
> src="jar:http://localhost:8888/mount/oo/sxw/{1}.sxw!/Pictures/
> {2}.png"
> mime-type="image/png"/>
> </map:match>
>
>
>
> <map:match pattern="sxw/*.sxw">
> <map:read src="sxw/{1}.sxw" mime-type="application/zip"/>
> </map:match>
>
>
> </map:pipeline>
> </map:pipelines>
> </map:sitemap>
>
> ----------------------------------------------------
>
> My environment:
> Debian GNU Linux 3.0
> java 1.4 from sun,
> Cocoon 2.1.3
> and Openoffice.org 1.1.0 hungary language
>
> --
> many thanks,
> Zoltan Zidarics programmer
> PTE University Pecs, Hungary
> icq: 43288694
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org