I've the following problem: Given the following stylesheet:
<xsl:stylesheet version = "2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fn="http://www.w3.org/2004/07/xpath-functions"
and the following input file:
<h1 xmlns:test="test">
This is a headline
</h1>
I get the following output:
<html>
<body>
<h1 xmlns:test="test">
This is a headline
</h1>
</body>
</html>
The problem is the xmlns:test namespace declaration, it should not occur in html output. How can I get rid of
this declaration. It always occurs when I copy elements from the input (with the namespace in scope) to the (html) output. Is there a way to tell saxon to remove the unused namespace declarations ?
thanks in advance
--peter
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've the following problem: Given the following stylesheet:
<xsl:stylesheet version = "2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fn="http://www.w3.org/2004/07/xpath-functions"
xmlns:test="test"
exclude-result-prefixes="fn xs test"
>
<xsl:output method="html"/>
<xsl:template match="/">
<html><body><xsl:sequence select="*"/></body></html>
</xsl:template>
</xsl:stylesheet>
and the following input file:
<h1 xmlns:test="test">
This is a headline
</h1>
I get the following output:
<html>
<body>
<h1 xmlns:test="test">
This is a headline
</body>
</html>
The problem is the xmlns:test namespace declaration, it should not occur in html output. How can I get rid of
this declaration. It always occurs when I copy elements from the input (with the namespace in scope) to the (html) output. Is there a way to tell saxon to remove the unused namespace declarations ?
thanks in advance
--peter
Try replacing
<xsl:sequence select="*"/>
with
<xsl:copy-of select="*" copy-namespaces="no"/>
Michael Kay