xsl-list
[Top] [All Lists]

RE: generate XHTML header without causing xmlns attributes in e.g. <table>?

2003-10-17 04:13:14
The problem isn't the xmlns="" declarations, the problem is that you
have put the <table> element is in the wrong namespace (actually, in no
namespace). Show us how you produce the table element. If you put the
element in the right namespace, the namespace declarations will look
after themselves.

Michael Kay

-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com 
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of 
Flemming Jønsson
Sent: 17 October 2003 07:58
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] generate XHTML header without causing xmlns 
attributes in e.g. <table>?


I need to generate valid XHTML 1 strict from my XSL stylesheet

My stylesheet starts with:
<xsl:stylesheet version="1.0" 
xmlns="http://www.w3.org/1999/xhtml"; 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:output method="xml" encoding="ISO-8859-1" 
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" 
doctype-system="DTD/xhtml1-strict.dtd" />

When I generate my XHTML document using Xalan-J, I get these 
headers in the XHTML file

<?xml version="1.0" encoding="ISO-8859-1"?>
              <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 
Strict//EN" "DTD/xhtml1-strict.dtd">
              <html xmlns="http://www.w3.org/1999/xhtml";>

Which is exactly what I want.

However, my tables cannot validate using w3c's validator, 
since they get an empty attribute with the name xmlns, like 
this: <table xmlns="" id="y" class="z">

Also the XHTML tags inside the table (not td/tr but all 
others) also get the xmlns attribute which has no value and 
they also get an xmlns:fo attribute like this: <br xmlns="" 
xmlns:fo="http://www.w3.org/1999/XSL/Format"; />

How can I generate valid XHTML1 without having those xmlns 
attributes inserted in table and <br>? If they must be there, 
how can I control their value?

Regards,
Flemming Joensson

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list