Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: XSL Transformation on an XML document with namespace >Thread Next - Re: XSL Transformation on an XML document with namespace Re: XSL Transformation on an XML document with namespaceTo: NULL Date: 10/5/2006 2:21:00 PM 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/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
