|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Extensions and namespace output
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
|
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
|

Cart








