cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jean-Claude Vogel" <vogel.jeancla...@gmail.com>
Subject Putting XMLNS declarations at begining
Date Mon, 26 May 2008 12:35:59 GMT
Hello guys,

I use an XSLT transformation in my sitemap and an XML serializer to generate
the HTTP response.

My pipe :
  <map:match pattern="program">
    <map:generate type="programGenerator"/>
    -- Here, my stream exists and has to be transformed --
    <map:call resource="myTransformer"/>
    <map:serialize type="xml"/>
  </map:match>

My transformer :
  <map:resource name="myTransformer">
      <map:transform type="xslt" src="myXSLT.xslt"/>
  </map:resource>

My serializer :
  <map:serializer logger="sitemap.serializer.xml" mime-type="text/html;
charset=UTF-8" name="xml"
src="org.apache.cocoon.serialization.XMLSerializer">
    <encoding>UTF-8</encoding>
    <omit-xml-declaration>no</omit-xml-declaration>
    <indent>yes</indent>
  </map:serializer>


My XSLT file :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
                xmlns:xxx_CD="urn:xxx:aa:schema:20050901"
                xmlns:xxx_TV="urn:xxx:bb:schema:20050901"
                xmlns:xxx_st="urn:xxx:cc:schema:20050901"
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:noNamespaceSchemaLocation="schema.xsd"
                >
....

Here is my the output data when I use my pipe :
<?xml version="1.0" encoding="UTF-8" ?>
<xxx_GRID date="2008-05-26" name="schema.xsd">
<balise>
<xxx:Content xmlns:xxx_CD="*urn:xxx:aa:schema:20050901*" attr1="248315"attr2
="ffffffffffff">
.....
</balise>

My problem is the xmlns:xxx_CD="*urn:xxx:aa:schema:20050901*", I would like
to have this namespace declaration one time for all at the begining of my
output XML file but I don't know if I have to modify the serializer, the
cocoon transformer, the XSLT file or something else. In fact for each
xxx:Content tag this declaration is redonded.

Can somebody help me about this problem ?

Thanks,
Jean-Claude

Mime
View raw message