cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcin Okraszewski <okr...@o2.pl>
Subject esql:get-xml improvement
Date Fri, 31 Oct 2003 15:26:30 GMT
Hi,
I found that using <esql:get-xml> I can't create a root element in a 
specified namespace so I have fixed it.

I added two attributes: "root-ns" and "root-ns-prefix" that may be used 
to define namespace. If not setting "root-ns-prefix" it overrides 
default namespace.

Here is new XSLT for esql:get-xml (only changed part, from line 925):

       <xsl:when test="@root">

         <xsl:text>"&lt;</xsl:text>
         <xsl:if test="@root-ns-prefix">
             <xsl:value-of select="@root-ns-prefix"/>
             <xsl:text>:</xsl:text>
         </xsl:if>
         <xsl:value-of select="@root"/>
         <xsl:if test="@root-ns">
             <xsl:text> xmlns</xsl:text>

             <xsl:if test="@root-ns-prefix">
                 <xsl:text>:</xsl:text>
                 <xsl:value-of select="@root-ns-prefix"/>
             </xsl:if>
             <xsl:text>=\&quot;</xsl:text>
             <xsl:value-of select="@root-ns"/>
             <xsl:text>\&quot;</xsl:text>

         </xsl:if>
         <xsl:text>&gt;"+</xsl:text>
         <xsl:call-template name="get-string"/>
         <xsl:text>+"&lt;/</xsl:text>
         <xsl:if test="@root-ns-prefix">
             <xsl:value-of select="@root-ns-prefix"/>
             <xsl:text>:</xsl:text>

         </xsl:if>
         <xsl:value-of select="@root"/>
         <xsl:text>&gt;"</xsl:text>
       </xsl:when>

If you find this usefull I would be pleased if you add it to CVS.

Regards,
Marcin Okraszewski

-- 
-------------------------------------------------------------
                       Marcin Okraszewski
okrasz@o2.pl                                       GG: 341942
okrasz@vlo.ids.gda.pl          PGP: www.okrasz.prv.pl/pgp.asc
-------------------------------------------------------------





Mime
View raw message