Hi all,
Trying a very simple transform using XalanJ 2.6.0.
---------- <XSL> ----------
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<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:stylesheet>
---------- </XSL> ----------
---------- <XHTML-IN> ----------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>foo</title>
</head>
<body>
<p>bar</p>
</body>
</html>
---------- </XHTML-IN> ----------
---------- <XHTML-OUT> ----------
<?doc type="doctype" role="title" { XHTML 1.1 } ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="-//W3C//DTD
XHTML 1.1//EN">
<head>
<title>foo</title>
</head>
<body>
<p>bar</p>
</body>
</html>
---------- </XHTML-OUT> ----------
I then hand this output to the w3c validator http://validator.w3.org/.
It returns the error:
line 3 column 53 - Error: there is no attribute "xmlns:xsi"
How can I annotate the XSL so that Xalan does not output the "xmlns:xsi"
attribute in the root element?
--
View this message in context:
http://www.nabble.com/remove-an-arbitrary-attribute-from-xsl-output-tf3538245.html#a9876757
Sent from the Xalan - J - Users mailing list archive at Nabble.com.