Stripping Duplicate Attributes in HTML --> XML generation

Hello,

I am using HTML-Tidy to generate a XML version of the HTML document. A problem I ran into was with duplicate attributes that causes XML parsers to choke on the generated XML.

If the input HTML is:

<TD WIDTH=40 NOWRAP ALIGN=RIGHT VALIGN=TOP NOWRAP>

The generated XML is:

<TD
width="40"
nowrap="nowrap"
align="RIGHT"
valign="TOP"
nowrap="nowrap">


Is it possible to fix HTML tidy so that it check for duplicate attributes and eliminates duplicates in the source for XML generation.

Thanks
-Sandip

Received on Friday, 19 November 1999 11:41:15 UTC