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

RE: Re: xsl-list Digest 31 Jul 2007 05:10:00 -0000 Iss

Subject: RE: Re: xsl-list Digest 31 Jul 2007 05:10:00 -0000 Issue 1213
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 31 Jul 2007 15:06:58 +0100
RE:  Re: xsl-list Digest 31 Jul 2007 05:10:00 -0000 Iss
> This clarification raises a related naive question, though: 
> What is the proper use of copy-namespaces="no"? What 
> namespace nodes will not be copied as a result of using it, 
> and in what sorts of situations would that be necessary or desirable?

consider

<soap:soap-envelope xmlns:soap="soap-namespace">
  <payload/>
</soap>

Doing <xsl:copy-of select="payload"/> will give you <payload
xmlns:soap="soap-namespace"/>. Using copy-namespaces="no" prevents the
namespace being copied. Copying the namespace is necessary if it's used in
the content, for example if the element is <payload
xsi:type="soap:payload"/>. The system can't tell whether the namespace is
used in the content, so it takes the safe default and assumes it is.

Usually excess namespaces do no harm, people like to get rid of them to
remove visual clutter and to reduce document sizes. Occasionally it is
necessary to remove them for other reasons, for example to make a document
DTD-valid.

Namespaces that are actually used in element and attribute names are copied
whether you like it or not.

Michael Kay
http://www.saxonica.com/

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.