Re: [xsl] xsl:call-template , strange behaviour

Subject: Re: [xsl] xsl:call-template , strange behaviour
From: Mukul Gandhi <mukul_gandhi@xxxxxxxxx>
Date: Sun, 5 Jun 2005 21:46:58 -0700 (PDT)
Thanks Colin for reply ..

Regards,
Mukul

--- Colin Paul Adams <colin@xxxxxxxxxxxxxxxxxx> wrote:

> >>>>> "Mukul" == Mukul Gandhi
> <mukul_gandhi@xxxxxxxxx> writes:
> 
>     Mukul> I have written this stylesheet - <?xml
> version="1.0"?>
>     Mukul> <xsl:stylesheet
>     Mukul>
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
>     Mukul> xmlns:temp="http://whatever";
> version="2.0">
>  
>     Mukul>  <xsl:output method="xml" indent="yes" />
> 
>     Mukul>  <xsl:template match="/">
> <xsl:call-template name="test" />
>     Mukul> <xsl:call-template name="temp:test" />
> </xsl:template>
> 
>     Mukul>  <xsl:template name="test"> <a/>
> </xsl:template>
>  
>     Mukul>  <xsl:template name="temp:test"> <b/>
> </xsl:template>
>  
>     Mukul> </xsl:stylesheet>
> 
>     Mukul> With both Xalan-J 2.6 and Saxon 8.4, I
> get the output -
>     Mukul> <?xml version="1.0" encoding="utf-8"?> <a
>     Mukul> xmlns:temp="http://whatever"/> <b
>     Mukul> xmlns:temp="http://whatever"/>
> 
>     Mukul> I am curious, why element <a> gets
> associated with the
>     Mukul> namespace 'temp' ..?
> 
> This is basic XML namespaces - you declared a
> default namespace on the
> document element (here xsl:stylesheet), and then you
> wrote an element
> without a namespace ( <a/> ), so it is in the
> default namespace.
> -- 
> Colin Adams
> Preston Lancashire
> 
> 



		
__________________________________ 
Discover Yahoo! 
Have fun online with music videos, cool games, IM and more. Check it out! 
http://discover.yahoo.com/online.html

Current Thread