Subject:Problem with transforming XMLs containing namespaces. Author:Arun MP Date:10 Aug 2006 12:45 AM
We are able to transform an XML using an XSLT and create an HTML output using Xalan, but when the XML has any namespace in it and when we try to transform it, we get the output as a text format ie, without any HTML tags in it.
Subject:Problem with transforming XMLs containing namespaces. Author:James Durning Date:10 Aug 2006 05:14 PM
You have at least a couple options.
1. Name the namespace, and change all your xpaths to use these namespaces.
eg, instead of <xsl:template match="someelem">
you have <xsl:template match="ddy:someelem">
and a xmlns:ddy="somenamespace.com" in your stylesheet node.
2. Change your xpaths to use wildcards, and use the local-name() function. eg.
<xsl:template match="*[local-name()="someelem"]>
This solution is better if you have no idea what namespace your xml is coming in as.
Would need to see a snippet of your xml/xslt to say anymore.