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

Re: Exclude result prefixes

Subject: Re: Exclude result prefixes
From: tcn@xxxxxxxxxxxxx (Trevor Nash)
Date: Sat, 04 Aug 2001 15:01:18 GMT
all sat prefixes
David Morris wrote:

>I was trying to clean up some generated xhtml and decided to get rid
>of some extra namespace declarations.  I tried to use the 
><xsl:exclude-result-prefixes> to get rid of some namespace declarations
>for namespaces that are not part of my output documents. This removed
>the unneccesary namespaces declaration from the element that I used it
>on (the root), but that just made caused the declaration to come back
>on the root's children.
>
>Thanks,
>
>David Morris
>
Two ideas:
When you say you put it on 'the root', do you mean the literal result
element which is to be the root of the output document, or the
xsl:stylesheet element?  (If you are using 'literal result element as
stylesheet' these are the same so ignore this bit).  Its usual to put
exclude-result-prefixes on the xsl:stylesheet - I don't think it
should make a difference, but you might try it.

My second guess is that you are using xsl:copy or xsl:copy-of.  The
problem is that these copy all the namespace nodes present.  Remember
you get a namespace node on an element for all namespaces declared on
that element *or* any of its ancestors: they do not just appear where
the actual declaration is.  There are two ways round this that I know
of:
  a) move the namespace declarations in the stylesheet or source
document so they do not appear on the nodes you are copying (not
always possible or practical)
  b) use xsl:element instead of xsl:copy (messy but it works) or
xsl:copy-of (even messier).

Or just live with it ;-)

Regards,
Trevor Nash

--
Traditional training & distance learning,
Consultancy by email

Melvaig Software Engineering Limited
voice:     +44 (0) 1445 771 271 
email:     tcn@xxxxxxxxxxxxx

 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.