Problem with syntax of html strict.dtd?

Discussion in 'XML' started by John Resler, Mar 15, 2005.

  1. John Resler

    John Resler Guest

    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
     
    John Resler, Mar 15, 2005
    #1
    1. Advertising

  2. John Resler

    Dean Tiegs Guest

    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>.
     
    Dean Tiegs, Mar 15, 2005
    #2
    1. Advertising

  3. John Resler

    John Resler Guest

    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.
     
    John Resler, Mar 15, 2005
    #3
  4. John Resler

    Dean Tiegs Guest

    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.
     
    Dean Tiegs, Mar 15, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joseph Tilian
    Replies:
    0
    Views:
    380
    Joseph Tilian
    Dec 21, 2004
  2. Ronald Fischer
    Replies:
    4
    Views:
    1,809
    Ronald Fischer
    Mar 17, 2005
  3. test
    Replies:
    2
    Views:
    2,194
    Oliver Wong
    Jul 28, 2006
  4. mcnewsxp

    HTML 4.01 strict.dtd

    mcnewsxp, Dec 20, 2010, in forum: HTML
    Replies:
    1
    Views:
    455
    Beauregard T. Shagnasty
    Dec 20, 2010
  5. Paul Marsh
    Replies:
    7
    Views:
    147
    cwdjr
    Sep 19, 2004
Loading...

Share This Page