You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by romDev <to...@yopmail.com> on 2009/05/20 17:17:31 UTC

Put namespaces (xmlns) to atributes of the root element

hi

i use cocoon to transform XML file to an other XML file with an XSLT

but my namespaces are generated on child nodes :

my namespace are :
xmlns:PCCAD_CD="urn:PCCAD:CD:schema:20050901" 
xmlns:PCCAD_TV="urn:PCCAD:TVLocation:schema:20050901" 
xmlns:PCCAD_st="urn:PCCAD:ST:schema:20050901"  

xml generated :
<PCCAD_GRID>
    PCCAD_TV:PublishedTime
xmlns:PCCAD_TV="urn:PCCAD:TVLocation:schema:20050901">2009-04-03T20:20:00Z</PCCAD_TV:PublishedTime>
    <PCCAD_TV:PublishedDuration
xmlns:PCCAD_TV="urn:PCCAD:TVLocation:schema:20050901">P0DT00H55M</PCCAD_TV:PublishedDuration>
    <PCCAD_TV:ServiceID
xmlns:PCCAD_TV="urn:PCCAD:TVLocation:schema:20050901">4</PCCAD_TV:ServiceID>
</PCCAD_GRID>


so I want to put it on the root élément of my XML
like this :
<PCCAD_GRID xmlns:PCCAD_TV="urn:PCCAD:TVLocation:schema:20050901" .....>

so i add on my xslt file this code (PCCAD_GRID is my root node) :
 
<xsl:template match="/">
		<PCCAD_GRID>	
			<!-- required add because namespace are removed in PCCAD : correction bug
250 / 251
			<xsl:attribute
name="xmlns:PCCAD_CD">urn:PCCAD:CD:schema:20050901</xsl:attribute>
			<xsl:attribute
name="xmlns:PCCAD_st">urn:PCCAD:ST:schema:20050901</xsl:attribute>
			<xsl:attribute
name="xmlns:PCCAD_TV">urn:PCCAD:TVLocation:schema:20050901</xsl:attribute>
			-->
		</PCCAD_GRID>
	</xsl:template>


but xmlns attributes of PCCAD_GRID are not generated.

WHY ????
-- 
View this message in context: http://www.nabble.com/Put-namespaces-%28xmlns%29-to-atributes-of-the-root-element-tp23637283p23637283.html
Sent from the Cocoon - Dev mailing list archive at Nabble.com.