Ok,
I did a little bit more messing around with the processors to see if I can replicate what you're seeing in PHP5.
I'm porting my app to work on .NET, ASP and PHP4 to begin with and them maybe later to others. I don't have PHP5 loaded so I couldn't check but here's what I found.
As you pointed out (rich_gib), removing xmlns="http://www.w3.org/1999/xhtml" from the <html> tag fixes the issue of having xmlns="" appearing throughout the generated code. However, in most cases I still end up with invalid markup because xmlns="http://www.w3.org/1999/xhtml" is not put back into the <html> tag during XSLT processing.
I've tried processing with MSXML, MSXML 3.0, MSXML 4.0 and .NET and in all cases xmlns="http://www.w3.org/1999/xhtml" is not added back to the <html> tag.
On the PHP4 front it's a little more interesting. I found that if I use DOMXML (experimental in PHP4) ie:
PHP Code:
$xmldoc = domxml_open_file("test.xml");
$xsldoc = domxml_xslt_stylesheet_file ("test.xsl");
$result = $xsldoc->process($xmldoc);
print $result->dump_mem();
xmlns="http://www.w3.org/1999/xhtml" is added back to the <html> tag
However, using PHP_XSLT ie:
PHP Code:
$xsltproc = xslt_create();
$html = xslt_process($xsltproc, 'arg:/_xml', $xsl_file, NULL, $arguments);
Doesn't add it back.
So... I don't think I can rely on the processor to add it back. Any thoughts about removing it from the stylesheet and then adding it back through XSL during the transformation?
I haven't given it much thought but it occured to me as I was writing this that it may be possible.
Thanks,
Andrew
Bookmarks