[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Add namespace to element name itself


Subject: Re: [xsl] Add namespace to element name itself
From: "Vasu Chakkera" <vasucv@xxxxxxxxx>
Date: Tue, 18 Nov 2008 12:23:31 +0000

> Thanks. But each and every element (output) contains "xmlns:ce='uri'".
>
It wont , unless you misused Mike's suggestions :)
if you do

   <xsl:template match="pii" priority="3">
               <xsl:element name="ce:{local-name()}" namespace="uri">
                       <xsl:apply-templates select="@*|node()" />
               </xsl:element>
       </xsl:template>

will produce
<item-info>
	<jid>YFMIC</jid>
	<aid>1120</aid>
	<ce:pii xmlns:ce="uri">S0740-0020(08)00080-4</ce:pii>
	<doi>10.1016/j.fm.2008.04.010</doi>
	<copyright type="unknown" year="2008"></copyright>
</item-info>


Unless this is not what you want...

Vasu Chakkera

On Tue, Nov 18, 2008 at 12:14 PM, V.Ramkumar
<v.ramkumar@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>> Michael Kay told
>> <xsl:element name="prefix:{local-name()}" namespace="uri">
>> where prefix and uri are your desired namespace prefix and namespace URI
>> respectively.
>
> Dear Michael,
>
> Thanks. But each and every element (output) contains "xmlns:ce='uri'".
>
> I don't want this, how to avoid it.
>
> Regards,
> Ramkumar
>
>



-- 
Vasu Chakkera
Numerical Algorithms Group Ltd.
Oxford
www.vasucv.com


Current Thread