pico wrote:
Yes, I'm also a bit confused about where "the <?doc ...?> processing
instruction" is coming from.
It's coming from the XHTML DTD. Without dissecting the whole thing, I'm
not sure why it's there.
The namespace binding for the schema instance namespace is also likely to
be coming from DTD as a fixed attribute. If that's the case, then the
validator is broken.
Namespace declarations are not attributes, so you cannot filter them out
using match patterns for attributes. You will need to create a new xhtml
element instead of copying it, since copying it will also copy the
namespace nodes:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
version="1.0"
exclude-result-prefixes="xhtml">
<xsl:output
method='xml'
version='1.0'
omit-xml-declaration='yes'
media-type='text/html'
doctype-public='-//W3C//DTD XHTML 1.1//EN'
doctype-system='http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'
indent='no'
encoding='UTF-8'/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="@profile"/>
<xsl:template match="@xml:space"/>
<xsl:template match="xhtml:*">
<xsl:element name="{local-name()}" namespace="{namespace-uri()}">
<xsl:apply-templates select="@*|node()"/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
Dave