Subject: Re: [xsl] Excluding unused and duplicate namespace declarations From: Ryan Puddephatt <rpuddephatt@xxxxxxxxxxxx> Date: Mon, 19 Mar 2007 10:27:21 +0000 |
Abel, Thats correct I did mean prefixes. I found a way to do what I need.
<xsl:template match="@*|node()"> <xsl:copy copy-namespaces="no"> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template>
Ryan Puddephatt Software Engineer
Teleflex Group - IT UK 1 Michaelson Square Livingston West Lothian Scotland EH54 7DP
e> rpuddehatt@xxxxxxxxxxxx <mailto:rpuddephatt@xxxxxxxxxxxx> t> +44(0)1506 407 110 f> +44(0)1506 407 108 w> www.teleflex.com <http://www.teleflex.com>
Ryan Puddephatt wrote:Hi all,
I'm trying to remove all the unused and duplicate declarations from my document, but they can change depending on the input, is there an easy way to do this?
Thanks in advance
Ryan
If you transform something with XSLT 2.0, you can set exclude-result-prefixes="#all" on the main xsl:stylesheet or xsl:transform element, which will remove all namespace declarations that are unused.
It doesn't matter whether your prefixes change. If your namespace changes, your whole document (i.e, the identity of your document and nodes) changes and you'll have to pull other tricks. But different namespaces for the same content are unlikely, so I presume you meant prefixes, right?
-- Abel Braaksma http://www.nuntia.nl
Ryan Puddephatt Software Engineer
Teleflex Group - IT UK 1 Michaelson Square Livingston West Lothian Scotland EH54 7DP
e> rpuddehatt@xxxxxxxxxxxx <mailto:rpuddephatt@xxxxxxxxxxxx> t> +44(0)1506 407 110 f> +44(0)1506 407 108 w> www.teleflex.com <http://www.teleflex.com>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Creating Nested Structure, Jeff Sese | Thread | [xsl] string-replace AND apply-temp, Florian Grammel |
RE: [xsl] [Fwd: Excluding unused an, Michael Kay | Date | [xsl] string-replace AND apply-temp, Florian Grammel |
Month |