[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
> 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/
|
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
|