cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robby Pelssers" <>
Subject problem with serialization Cocoon2.2
Date Fri, 17 Jun 2011 11:18:06 GMT

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: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:serialize type="p-topic"/>       
           <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 pattern="test">
             <map:generate src="data/pinning_information.xml"/>
             <map:serialize type="xml"/>

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">
            <doctype-public>-//NXP//DTD P-Topic//EN</doctype-public>

The pattern "basictype/*/*/*" generates a DITA topic by transforming the result of an Xquery.

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">

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