XSL: I get namespace attributes showing up all over my result document. How do I get rid of them?

Alex Chaffee

If you include a namespace in the root element of your source document, a spec-compliant XSLT processor is supposed to duplicate it into the resulting document. This is often not what you want. To get rid of it, there's an attribute you can include in the XSL stylesheet:

        exclude-result-prefixes="pp xlink"

exclude-result-prefixes is a white-space delimited list of namespaces to supress in the output. You can also include this directive as <xsl:exclude-result-prefixes> for portions of an xsl transform (I think).

(Thanks to Brian Dupras, briand@centera.com, for solving this.)

About | Sitemap | Contact