Re: How Can I omit DOCTYPE using Tidy COM/MXSML

Ciaran,

The proper public IDs for XHTML (the XML implementation of HTML) are:

<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "DTD/xhtml1-strict.dtd">

<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "DTD/xhtml1-transitional.dtd">

<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
     "DTD/xhtml1-frameset.dtd">

Case is important.

I cut and paste these directly from the W3C site at
http://www.w3.org/TR/xhtml1/

Ken

----- Original Message -----
From: "ciaran byrne" <ciaran.byrne@3tl.com>
To: <html-tidy@w3.org>
Sent: Friday, July 28, 2000 06:46 AM
Subject: How Can I omit DOCTYPE using Tidy COM/MXSML


> Hi all,
> I using Tidy COM to convert my HTML to XML and then use MSXML.
> The problem I'm getting is that even though I set the doctype to omit,
> I still get the doctype outputted by Tidy. I also seem to get a HTML
DOCTYPE
> even though the output is XML which in my eyes would mean an XML DOCTYPE.
> As a result MSXML doesn't like this DOCTYPE and coughs up an error.
> Is there any way for the DOCTYPE to be omitted, or is there a workaround ?
> Below is my code:
>
> Set TidyObj = CreateObject("TidyCOM.TidyObject")
> TidyObj.Options.doctype = "omit"
> TidyObj.Options.NumericEntities = True
> TidyObj.Options.TidyMark = False
> TidyObj.Options.UppercaseTags = True
> TidyObj.Options.OutputXml = True
> strHTML = TidyObj.TidyToMem(strHTML)
>
> ' XML is loaded here
> docXML.loadXML (strHTML)
>
> If docXML.parseError.errorCode <> 0 Then
>  .....
>
> Here is my error:
> The public ID "-\\W3C\\DTD HTML 4.0 Transitional\\EN" is invalid.
>
> Anyone have any suggestions ?
>
> Ciaran
>

Received on Saturday, 29 July 2000 12:32:20 UTC