You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Joel P W Pitt <jp...@student.canterbury.ac.nz> on 2003/09/22 03:17:49 UTC
Transformation not working
Hi all,
I'm having some frustrating problems in my web application.
I have a pipeline to create a geographical map, with a match as shown:
<map:match pattern="map.xsp">
<map:generate src="documents/map.xsp" type="serverpages"/>
<map:transform type="JPath"/>
<map:transform type="WFSmap">
<map:parameter name="wfs-server"
value="http://linux1:8080/geoserver"/>
<map:parameter name="colour-index" value="true"/>
</map:transform>
<!-- change transform to cocoon:/gmltosvg.xsl for dynamic xsl
creation-->
<map:transform type="xalan" src="cocoon:/gmltosvg.xsl"/>
<map:serialize type="svg2png"/>
<!--<map:serialize type="xml"/>-->
</map:match>
It is called from a flowscript method, and should display a png map of
points.
WFSmap is a custom transformer of mine that retrieves an XML file of map
locations. cocoon:/gmltosvg.xsl is a xsl that is created by another
transformer
in the following match:
<!-- Dynamic gmltosvg xsl creator -->
<map:match pattern="gmltosvg.xsl">
<map:generate
src="http://linux1:8080/geoserver/DescribeFeatureType?"/>
<map:transform type="xalan" src="transforms/schematoxsl.xsl"/>
<map:transform type="xinclude"/>
<map:serialize type="xml"/>
</map:match>
Now, the problem is, that the image is always blank when called using the
first match. Now, you might question that it is a problem somewhere in
my xsl
or transformer, and I certainly did at first. However, when I skip the
svg part and
just display the xml, as shown:
<map:match pattern="map.xsp">
<map:generate src="documents/map.xsp" type="serverpages"/>
<map:transform type="JPath"/>
<map:transform type="WFSmap">
<map:parameter name="wfs-server"
value="http://linux1:8080/geoserver"/>
<map:parameter name="colour-index" value="true"/>
</map:transform>
<map:serialize type="xml"/>
</map:match>
... then the produced xml is exactly what I expect. I then saved this as
an xml file
(map.png.xml) and tried applying the removed transformations:
<map:match pattern="map2.png">
<map:generate src="map.png.xml"/>
<map:transform type="xalan" src="cocoon:/gmltosvg.xsl"/>
<map:serialize type="svg2png"/>
</map:match>
Now, this gives me the png of the map exactly as I want it. But why
doesn't it
work in the very first match I tried above?
Am I doing something wrong or is this a cocoon bug?
I've tried making the pipeline noncaching in case that was the problem
(since
the initially displayed map is meant to be blank, and the user selects what
features to display). Maybe it is something to do with having an XSLT
produced
by another XSLT?
Any insights appreciated, because I truly am stuck otherwise.
Thanks,
Joel
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Transformation not working
Posted by Joel P W Pitt <jp...@student.canterbury.ac.nz>.
Hi Joerg,
You were right. My transformer wasn't generating the right events, the
main problem was
that the events were missing namespaces. Thanks for pointing me in the
right direction! :)
Joel
Joerg Heinicke wrote:
> Hello Joel,
>
> it seems to be a problem with the SAX events. The working of the
> solution with the intermediate file points on that. Can you add the
> log transformer before the WFSmap transformer and after the
> transformation step with "cocoon:/gmltosvg.xsl".
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Transformation not working
Posted by Joerg Heinicke <jh...@virbus.de>.
Hello Joel,
it seems to be a problem with the SAX events. The working of the
solution with the intermediate file points on that. Can you add the log
transformer before the WFSmap transformer and after the transformation
step with "cocoon:/gmltosvg.xsl".
Joerg
Joel P W Pitt wrote:
> Hi all,
>
> I'm having some frustrating problems in my web application.
>
> I have a pipeline to create a geographical map, with a match as shown:
>
> <map:match pattern="map.xsp">
> <map:generate src="documents/map.xsp" type="serverpages"/>
> <map:transform type="JPath"/>
> <map:transform type="WFSmap">
> <map:parameter name="wfs-server"
> value="http://linux1:8080/geoserver"/>
> <map:parameter name="colour-index" value="true"/>
> </map:transform>
> <!-- change transform to cocoon:/gmltosvg.xsl for dynamic xsl
> creation-->
> <map:transform type="xalan" src="cocoon:/gmltosvg.xsl"/>
>
> <map:serialize type="svg2png"/>
> <!--<map:serialize type="xml"/>-->
>
> </map:match>
>
> It is called from a flowscript method, and should display a png map of
> points.
> WFSmap is a custom transformer of mine that retrieves an XML file of map
> locations. cocoon:/gmltosvg.xsl is a xsl that is created by another
> transformer
> in the following match:
>
> <!-- Dynamic gmltosvg xsl creator -->
> <map:match pattern="gmltosvg.xsl">
> <map:generate
> src="http://linux1:8080/geoserver/DescribeFeatureType?"/>
> <map:transform type="xalan" src="transforms/schematoxsl.xsl"/>
> <map:transform type="xinclude"/>
> <map:serialize type="xml"/>
> </map:match>
>
> Now, the problem is, that the image is always blank when called using the
> first match. Now, you might question that it is a problem somewhere in
> my xsl
> or transformer, and I certainly did at first. However, when I skip the
> svg part and
> just display the xml, as shown:
>
> <map:match pattern="map.xsp">
> <map:generate src="documents/map.xsp" type="serverpages"/>
> <map:transform type="JPath"/>
> <map:transform type="WFSmap">
> <map:parameter name="wfs-server"
> value="http://linux1:8080/geoserver"/>
> <map:parameter name="colour-index" value="true"/>
> </map:transform>
>
> <map:serialize type="xml"/>
>
> </map:match>
>
> ... then the produced xml is exactly what I expect. I then saved this as
> an xml file
> (map.png.xml) and tried applying the removed transformations:
>
> <map:match pattern="map2.png">
> <map:generate src="map.png.xml"/>
> <map:transform type="xalan" src="cocoon:/gmltosvg.xsl"/>
> <map:serialize type="svg2png"/>
> </map:match>
>
> Now, this gives me the png of the map exactly as I want it. But why
> doesn't it
> work in the very first match I tried above?
>
> Am I doing something wrong or is this a cocoon bug?
> I've tried making the pipeline noncaching in case that was the problem
> (since
> the initially displayed map is meant to be blank, and the user selects what
> features to display). Maybe it is something to do with having an XSLT
> produced
> by another XSLT?
>
> Any insights appreciated, because I truly am stuck otherwise.
>
> Thanks,
> Joel
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org