Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - exclude-result-prefixes not working on server side transformation [Thread Next] Re: exclude-result-prefixes not working on server side transformationTo: NULL Date: 12/8/2004 2:11:00 PM
Keith Chadwick wrote:
> Have a server side transformation that transforms data returns via
> SqlXMLCommand. But the server side transform is not removing the
> sql namespace. Code is as follows
> sSQL = "<ROOT xmlns:sql=""urn:schemas-microsoft-com:xml-sql"">"
> sSQL += "<contacts>"
> sSQL += "<sql:query>Select * from contacts for xml auto</sql:query>"
> xmlstr = "<?xml version='1.0'?>"
> xmlstr += "<xsl:stylesheet version=""1.0""
> xmlns:xsl=""http://www.w3.org/1999/XSL/Transform""
> xmlns:sql=""urn:schemas-microsoft-com:xml-sql"" "
> xmlstr += " exclude-result-prefixes=""sql"" >"
> xmlstr += "<xsl:copy-of select="".""/>"
You are copying nodes with the namespace, if you want to transform an
element in a namespace to an unqualified element then you need to do
that explictly e.g.
<xsl:template match="sql:query">
<xsl:element name="{local-name()}">
<xsl:apply-templates />
</xsl:element>
</xsl:template>
--
Martin Honnen
http://JavaScript.FAQTs.com/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
