Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Problem with syntax of html strict.dtd?

Reply
Thread Tools

Problem with syntax of html strict.dtd?

 
 
John Resler
Guest
Posts: n/a
 
      03-15-2005
Hi,
I am trying to track down a bug in a program I've written which
parses an XHTML document. The document has been cleaned up with Tidy and
converted to XHTML and has a strict.dtd reference. When the xerces
parser hits a line in the dtd, I get the following output:

**Parsing Fatal Error**
Line: 81
URI: http://www.w3.org/TR/REC-html40/strict.dtd
Message: The declaration for the entity "ContentType" must end with '>'.

I looked at the dtd in XMLSpy and elsewhere and it does seem to be
incorrect... can anybody help me out here?


-John
 
Reply With Quote
 
 
 
 
Dean Tiegs
Guest
Posts: n/a
 
      03-15-2005
On Tue, 15 Mar 2005 04:00:21 +0000, John Resler wrote:

> I am trying to track down a bug in a program I've written which
> parses an XHTML document. The document has been cleaned up with Tidy and
> converted to XHTML and has a strict.dtd reference. When the xerces
> parser hits a line in the dtd, I get the following output:
>
> **Parsing Fatal Error**
> Line: 81
> URI: http://www.w3.org/TR/REC-html40/strict.dtd
> Message: The declaration for the entity "ContentType" must end with '>'.
>
> I looked at the dtd in XMLSpy and elsewhere and it does seem to be
> incorrect... can anybody help me out here?


That's an HTML DTD, so it's no wonder that an XML parser cannot parse it.
Try using an XHTML DTD, such as
<http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd>.

 
Reply With Quote
 
 
 
 
John Resler
Guest
Posts: n/a
 
      03-15-2005
Dean Tiegs wrote:
> On Tue, 15 Mar 2005 04:00:21 +0000, John Resler wrote:
>
>
>> I am trying to track down a bug in a program I've written which
>>parses an XHTML document. The document has been cleaned up with Tidy and
>>converted to XHTML and has a strict.dtd reference. When the xerces
>>parser hits a line in the dtd, I get the following output:
>>
>>**Parsing Fatal Error**
>> Line: 81
>> URI: http://www.w3.org/TR/REC-html40/strict.dtd
>> Message: The declaration for the entity "ContentType" must end with '>'.
>>
>>I looked at the dtd in XMLSpy and elsewhere and it does seem to be
>>incorrect... can anybody help me out here?

>
>
> That's an HTML DTD, so it's no wonder that an XML parser cannot parse it.
> Try using an XHTML DTD, such as
> <http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd>.
>

Ok, but it's still a dtd and has to conform to rules for dtd format.
Why the parse error? I thought a dtd was a dtd...? Thanks for the
help by the way.
 
Reply With Quote
 
Dean Tiegs
Guest
Posts: n/a
 
      03-15-2005
On Tue, 15 Mar 2005 04:47:48 +0000, John Resler wrote:

> Ok, but it's still a dtd and has to conform to rules for dtd format.
> Why the parse error? I thought a dtd was a dtd...? Thanks for the
> help by the way.


There are SGML DTDs and then there are XML DTDs. HTML is an SGML
language, so it has an SGML DTD. XHTML is an XML language and has an XML
DTD.

XML is a subset of SGML, so an SGML parser can parse XML documents and
DTDs, but in general an XML parser cannot parse SGML documents and DTDs.

For example, in SGML it's OK to put comments inside entity declarations
(delimited with double hyphens: --this is a comment--), but in XML this is
forbidden. It is just such a comment that your XML parser is rejecting.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax Checker that's better than the normal syntax checker Jacob Grover Ruby 5 07-18-2008 05:07 AM
Syntax error? What syntax error? Assignment fo default values? Mark Richards Perl Misc 3 11-18-2007 05:01 PM
Syntax bug, in 1.8.5? return not (some expr) <-- syntax error vsreturn (not (some expr)) <-- fine Good Night Moon Ruby 9 07-25-2007 04:51 PM
[ANN] SqlStatement 1.0.0 - hide the syntax of SQL behind familiarruby syntax Ken Bloom Ruby 3 10-09-2006 06:46 PM
Syntax highligth with textile: Syntax+RedCloth ? gabriele renzi Ruby 2 12-31-2005 02:44 AM



Advertisments