[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: xsl:call-template , strange behaviour
>>>>> "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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|