cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "J.Pietschmann" <j3322...@yahoo.de>
Subject Re: removing namespaces...
Date Wed, 26 Nov 2003 19:55:59 GMT
Patrick Hess wrote:
> I currently facing the well-known problem of "how to remove namespace 
> declarations from my HTML files?". After testing a bit I found that the 
> exclude-prefixes="..." approach works fine for me - even if the Wiki 
> lists this under "Solutions, which do NOT work".

Exclude-result-prefixes  prevents the output of *unused* namespaces.
It won't remove namespaces which are referenced, and namespace
declarations which have been copied from the input.
If you want to be sure you don't copy otherwise unused namespace,
use
  <xsl:template match="*" mode="copy">
    <xsl:element name="{local-name()}" namespace="{namespace-uri()}">
      <xsl:copy-of select="@*/>
      <xsl:apply-templates mode="copy"/>
    </xsl:element>
  </xsl:element>
instead of xsl:copy-of, and modify usages of xsl:copy in a similar way.

You also can't use exclude-result-prefixes to transform XHTML (using the
XHTML namespace) into HTML 4.x (no namespace). Use the "cleanxmlns"
posted downthread for this task.

J.Pietschmann



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message