This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Extensions and namespace output
- To: Heiko Rupp <heiko dot rupp at WiredMinds dot de>
- Subject: Re: [xsl] Extensions and namespace output
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Wed, 15 Aug 2001 17:39:46 +0100
- CC: XSL-List at lists dot mulberrytech dot com
- Organization: Jeni Tennison Consulting Ltd
- References: <3B7A97E1.5070401@wiredminds.de>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Heiko,
> do I read XSLT 1.0 Standard, 7.1.1 correctly, that if a namespace
> designates an extension, its namespace is not copied to output
> elements?
Yes-ish. If you have:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:foo="my.extension.url"
extension-element-prefixes="foo">
<xsl:template match="/">
<doc>...data...</doc>
</xsl:template>
</xsl:stylesheet>
then you should get:
<doc>...data...</doc>
*However*, just because you say that an element is used as the prefix
for extension elements or should be excluded from the result (with
exclude-result-prefixes) doesn't necessarily mean that the namespace
will not be present in the result. It just means that it won't be
included when you create an element with xsl:element or with a literal
result element.
So if you have source XML like:
<doc xmlns:foo="my.extension.url">...data...</doc>
and then you *copy* that doc element with xsl:copy or xsl:copy-of,
then the my.extension.url namespace *will* appear in the result.
To get round that, you have to 'copy' the element using xsl:element
or a literal result element instead.
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list