cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robby Pelssers" <>
Subject RE: problem with serialization Cocoon2.2
Date Thu, 23 Jun 2011 11:53:07 GMT

Hi Huib,

Actually i'm still facing this issue.  I will give it a try.. But it is indeed a strange issue.
 One option that came to my mind was that the generator actually behaves differently when
using the cocoon protocol.  

<map:match pattern="topic2xhtml/**">
  <map:generate src="cocoon:/{1}"/>

But that would take me quite some time to setup my environment to dive into the cocoon sources
and step through the code.  I will first see if twiddling with those pipelines makes a difference.

Thx for thinking along,

-----Oorspronkelijk bericht-----
Van: Huib Verweij []
Verzonden: do 23-6-2011 13:03
CC: Huib Verweij
Onderwerp: Re: problem with serialization Cocoon2.2
Hi Robby,

did you fix it already?

Seems like a strange situation to me.

Maybe Cocoon gets confused by the p-topic serializer, even though it's really a XML serializer
in disguise. You could move the "work" to a separate pipeline, serialize that to p-topic in
"basictype/*/*/*" and serialize that to HTML in "topic2xhtml/**". 

Hartelijke groet,

Huib Verweij.

Op 17 jun 2011, om 13:18 heeft Robby Pelssers het volgende geschreven:

> Hi all,
> I have a strange situation I don't really understand.
> In my sitemap I have following patterns:
>           <!-- 
>             {1}: basictype-id
>             {2}: state
>             {3}: topic-id
>            -->
>           <map:match pattern="basictype/*/*/*">
>             <map:generate src="xquery/getTopic.xquery" type="queryStringXquery">
>               <map:parameter name="basictypeId" value="{1}"/>             
>               <map:parameter name="state" value="{2}"/>
>               <map:parameter name="topicId" value="{3}"/>               
>             </map:generate>
>             <map:transform src="xslt/postprocessXqueryResults.xslt" type="saxon"/>
>             <map:transform src="xslt/urlTransformer.xslt" type="saxon">
>               <map:parameter name="contextpath" value="{request:contextPath}"/>
>               <map:parameter name="drawingExtension" value="{request-param:drawingExtension}"/>
>             </map:transform>             
>             <map:serialize type="p-topic"/>       
>           </map:match>
>           <map:match pattern="topic2xhtml/**">
>             <map:generate src="cocoon:/{1}"/>
>             <map:transform src="xslt/dita/xslhtml/dita2xhtml.xsl" type="saxon"/>
>             <map:serialize type="xhtml"/>
>           </map:match>
>           <map:match pattern="test">
>             <map:generate src="data/pinning_information.xml"/>
>             <map:serialize type="xml"/>
>           </map:match>
> And configured following serializer:
>          <map:serializer name="p-topic" logger="sitemap.serializer.xml"  
>             mime-type="text/xml;charset=utf-8" src="org.apache.cocoon.serialization.XMLSerializer">
>            <encoding>UTF-8</encoding>
>            <doctype-public>-//NXP//DTD P-Topic//EN</doctype-public>
>            <doctype-system>${p-topic-dtd}</doctype-system>
>          </map:serializer>
> The pattern "basictype/*/*/*" generates a DITA topic by transforming the result of an
> When I invoke http://localhost:8888/topics/basictype/PH3330L/released/pinning_information?drawingExtension=gif
in the browser and save the result [1] to filesystem I see that the doctype has been added
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <!DOCTYPE p-topic PUBLIC "-//NXP//DTD P-Topic//EN" "">
> <p-topic id="pinning_information">
>  ...
> </p-topic>
> When I invoke http://localhost:8888/topics/topic2xhtml/basictype/PH3330L/released/pinning_information
I would expect the topic to get transformed correctly into XHTML.  This does not work however.
 Just for testing purpose I added [1] in my app into /data/pinning_information.xml and created
a new match pattern which reads [1] from disc
> But when i now try to invoke http://localhost:8888/topics/topic2xhtml/test the DITA topic
does get transformed correctly.
> Is there a difference between 
> a)  calling a pipeline that generates a DITA topic on the fly and serializes it using
my custom serializer which is used as input for the 
>    topic2xhtml/**  pattern
> b)  reading the DITA topic from filesystem which is used as input for the topic2xhtml/**
> It looks like the class attributes which should be added by the DTD are not added in
use-case (a) which is why the transform fails.
> Any insight is appreciated.
> Kind regards,
> Robby Pelssers

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message