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

Re: Extensions and namespace output

Subject: Re: Extensions and namespace output
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Wed, 15 Aug 2001 17:39:46 +0100
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


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.