[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: xsl:call-template , strange behaviour

Subject: Re: xsl:call-template , strange behaviour
From: Colin Paul Adams <colin@xxxxxxxxxxxxxxxxxx>
Date: 06 Jun 2005 05:23:58 +0100
Re:  xsl:call-template
>>>>> "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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.