At 2006-04-14 20:50 +0530, Ramakant Akhairamka wrote:
when i try to use <xsl:element .. /> in main template it gets generated fine.
But when i call another template from this one and then use
<xsl:element name="abc />, it generates <abc xmlns=""> .
...
<xsl:template match="/">
<Tag1 xmlns="http://www.abc.com/wahtever"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.abc.com/wahtever myschema.xsd">
<xsl:element name="abc" />
Note in the above how you have a default namespace in scope.
<xsl:template name="tem1">
<xsl:element name="abc" />
But above, you not have a default namespace in scope.
<Tag1 xmlns:a="http://www.abcd.com/abCD"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.abc.com/wahtever"
xsi:schemaLocation="http://www.abc.com/wahtever myschema.xsd">
<abc/>
<abc xmlns=""/>
So the above results are expected.
If you need the <abc/> to be in the same namespace, then move the
xmlns="http://www.abc.com/wahtever" declaration to the stylesheet
document element.
Chapter and verse of XSLT 1.0 7.1.2 reads:
"If the namespace attribute is not present then the QName is expanded
into an expanded-name using the namespace declarations in effect for
the xsl:element element, including any default namespace declaration."
I hope this helps.
. . . . . . . . . . . . Ken
--
Registration open for XSLT/XSL-FO training: Wash.,DC 2006-06-12/16
Also for XML/XSLT/XSL-FO training:Birmingham,England 2006-05-22/25
Also for XSLT/XSL-FO training: Copenhagen,Denmark 2006-05-08/11
World-wide on-site corporate, govt. & user group XML/XSL training.
G. Ken Holman mailto:gkholman(_at_)CraneSoftwrights(_dot_)com
Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
Male Cancer Awareness Aug'05 http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers: http://www.CraneSoftwrights.com/legal
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--