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 namespaceTo: 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/ > | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
