When I translate and XML file that defines namespaces, I get the namespaces showing up in HTML tags. ? ?
I'm using Saxon 8B and Oxygen 7.0
I've created a small XML and XSLT file to show the problem:
XML File:
Code:
<?xml version="1.0" encoding="UTF-8"?><?mso-application progid="Excel.Sheet"?>
<Workbook
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Cell>Inside the Cell 1</Cell>
<Cell>Inside the Cell 2</Cell>
</Workbook>
The XSLT File:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!--
****************************************************
-->
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/Workbook">
<xsl:text>Found Workbook</xsl:text>
<xsl:apply-templates select="Cell"></xsl:apply-templates>
</xsl:template>
<!--
****************************************************
Template for Cell
****************************************************
-->
<xsl:template match="Cell">
<br/><xsl:text>Inside the Cell</xsl:text>
</xsl:template>
</xsl:stylesheet>
And finally the output:
Code:
<?xml version="1.0" encoding="UTF-8"?>Found Workbook<br xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>Inside the Cell<br xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>Inside the Cell
Notice the translated <br/> tags.. they have the xsi namespace declaration appearing inside the tags.
What's up with that?
------------------------
GnuPG Key fingerprint = 1AD4 726D E359 A31D 05BF ACE5 CA93 7AD5 D8E3 A876
Michael Hare