I have seen this resource link text but I still have troubles generating a valid XHTML document using MSXML parser.
I have in input the following document:
<?xml version="1.0" encoding="UTF-8" ?>
- <html xml:lang="it" xmlns="http://www.w3.org/1999/xhtml">
- <head xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Bla bla bla</title>
<link rel="stylesheet" type="text/css" media="screen" href="css/bla.css" />
</head>
- <body xmlns="" style="background-color:#DFDFDF;left-margin:0;margin-top:0">
....
</body>
</html>
where the nasty xmlns="" are produced because i have inserted the instruction:
parserInstance.documentElement.setAttribute "xmlns", "http://www.w3.org/1999/xhtml"
when creating the input document before transformation.
The XSLT imports the transformation I use for catching the html elements
<xsl:stylesheet
version="1.0"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="xhtml xsl"
>
<xsl:import href="_lib.xsl"/>
<xsl:import href="_standard.xsl"/>
and within _standard.xsl I have the code that make the rerlevant transformation:
<xsl:template match="html">
<xsl:copy>
<xsl:copy-of select="@*" />
<xsl:apply-templates select="head" />
<xsl:apply-templates select="body" />
</xsl:copy>
Still I do not have the required xmlns in the html markup:
<html xml:lang="it">
AND I still have the nasty xmlns intersparsed in html code:
<h1 xmlns="http://www.w3.org/1999/xhtml">BLA BLA</h1>
Where I am getting wrong?
Please, NOTE: i MUST use a pull model for transformation, I cannot use an identity transform