You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Marcin Okraszewski <ok...@o2.pl> on 2003/10/31 16:26:30 UTC

esql:get-xml improvement

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





Re: esql:get-xml improvement

Posted by Torsten Curdt <tc...@vafer.org>.
Marcin Okraszewski wrote:
> 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):

please create a "diff -u" patch and submit it to bugzilla

thanks
--
Torsten