You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Mike O'Leary <tm...@comcast.net> on 2007/03/01 10:41:10 UTC

Converting entities in an SGML DTD file to comply with XML DTD syntax

I am working with a collection of XML documents that I need to parse in
order to index them in Lucene. There is a DTD file that describes the
structure of these documents, but when I started working with it I found out
that it was an SGML DTD file. I found some advice on the internet about how
to convert an SGML DTD file so that it complies with XML DTD standards, and
I made changes to enable the DTD file to be used by an XML parser. There was
one !ENTITY declaration that I didn't know what to do with. It looks like
this:

 

<!ENTITY #DEFAULT SYSTEM >

 

Things seem to work ok if I just comment this out, but I wonder what it is
for, and whether there is a way to make it acceptable to an XML parser in
such a way that it does what the original author meant for it to do.
Apparently the XML parser doesn't like the # at the start of #DEFAULT.
Thanks.

Mike O'Leary


Re: Converting entities in an SGML DTD file to comply with XML DTD syntax

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
I think "<!ENTITY #DEFAULT" declares a default entity to use for 
references to undeclared entities. There's no equivalent in XML.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

"Mike O'Leary" <tm...@comcast.net> wrote on 03/01/2007 04:41:10 AM:

> I am working with a collection of XML documents that I need to parse
> in order to index them in Lucene. There is a DTD file that describes
> the structure of these documents, but when I started working with it
> I found out that it was an SGML DTD file. I found some advice on the
> internet about how to convert an SGML DTD file so that it complies 
> with XML DTD standards, and I made changes to enable the DTD file to
> be used by an XML parser. There was one !ENTITY declaration that I 
> didn?t know what to do with. It looks like this:
> 
> <!ENTITY #DEFAULT SYSTEM >
> 
> Things seem to work ok if I just comment this out, but I wonder what
> it is for, and whether there is a way to make it acceptable to an 
> XML parser in such a way that it does what the original author meant
> for it to do. Apparently the XML parser doesn?t like the # at the 
> start of #DEFAULT. Thanks.
> Mike O?Leary

---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org