XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
RE: [xml-dev] expat question: reading DTD


-----Original Message-----
From: rickc@rdrop.com [mailto:rickc@rdrop.com] 
Sent: Tuesday, January 18, 2005 8:14 AM
To: xml-dev@lists.xml.org
Subject: [xml-dev] expat question: reading DTD


Hello -

Somewhere in the expat docs this list is given as a place to
ask questions. I've looked on the web for an answer
and have come up empty, so I hope it's OK to ask here.

What I want to do is use expat to read HTML 4.01. I have
no problem with the requirement of the input being
well formed. But, to do this I have to read the standard
"loose" or "strict" DTD. 

What I've tried:

XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
XML_SetExternalEntityRefHandler(parser,ext_ref_handler);

and then in ext_ref_handler, create a sub_parser:

XML_ExternalEntityParserCreate(parser,context,encoding)

and feed the DTD file to it.

The problem:

It chokes on the first non-comment line (an ENTITY) in loose.dtd
from w3.org with a syntax error. It doesn't seem to like the "--"
as a comment delimiter.

Should I not use loose.dtd? I kinda assumed it is a valid DTD...

Are there any examples/samples of parsing a DTD? I found lots of
descriptions of how to do it (which seems to be what I did) but
no code.

This is with version expat-1.95.8 

Thanks,

Rick

rickc
rdrop.com



-----------------------------------------------------------------
The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
initiative of OASIS <http://www.oasis-open.org>

The list archives are at http://lists.xml.org/archives/xml-dev/

To subscribe or unsubscribe from this list use the subscription
manager: <http://www.oasis-open.org/mlmanage/index.php>
<a href="http://www.avidware.net/";>Microsoft Certified Partner los
angeles</a>


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]





News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2006 XML.org. This site is hosted by OASIS