Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: XSL Transformation on an XML document with namespace

From: BjrnTerjeSvennes@-----------.---------.---
To: NULL
Date: 10/6/2006 4:12:00 AM

Thank you very much. Your advices have been very helpful.

I've tried handling the XSLT-file as a XmlDocument. The xsl-namespace used 
in XSLT-files demands a namespace manager to work properly. The final 
solution was to actually remove the entire namespace. It was to no use for me 
anyway. I found an implementation of an XmlWriter that removes namespace.

- Bjørn Terje

"Martin Honnen" wrote:

> 
> 
> Bjørn Terje Svennes wrote:
> 
> > Do you know if there is a way to programatically tell the XSL-file which 
> > namespace to use? The transformation works if I specify 
> > xmlns:pf="http://tempuri.org/ArchiveDataSet.xsd", but the namespace might 
> > change from time to time.
> 
> There is no direct mechanism unless you write XPath expressions and 
> match patterns in the form e.g.
> 
>    <xsl:template match="*[local-name() = 'local-element-name' and 
> namespace-uri() = $custom-namespace]">
> 
> and keep a global parameter e.g.
> 
>    <xsl:param name="$custom-namespace" 
> select="'http://tempuri.org/ArchiveDataSet.xsd'"/>
> 
> Such a global parameter can be set programmatically before running a 
> transformation, see 
> <http://msdn2.microsoft.com/en-us/library/system.xml.xsl.xsltargumentlist.addparam.aspx> 
> for .NET.
> 
> Besides that a second approach is to treat the stylesheet as an XML 
> document and use the DOM or even XSLT to manipulate the stylesheet 
> before using it.
> 
> 
> -- 
> 
> 	Martin Honnen --- MVP XML
> 	http://JavaScript.FAQTs.com/
> 


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent