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:

<xsl:stylesheet
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:pp="http://medwired.com/namespaces/practiceportal/1.0"
        xmlns:xlink='http://www.w3.org/XML/XLink/0.9'
        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.)

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact