I'm assuming that you are talking about the Java version only?

----------------------------------------
Dean Roddey
Software Weenie
IBM Center for Java Technology - Silicon Valley
[EMAIL PROTECTED]



Elliotte Rusty Harold <[EMAIL PROTECTED]> on 03/06/2000 11:44:44 AM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:
Subject:  Re: Validating against a different DTD



>Elliotte Rusty Harold wrote:
>
> > Is there any way in Xerces I can easily choose a specific DTD/schema to
> > validate documents against from within the parser?
> >
At 12:01 AM +0800 3/1/00, Wong Kok Wai wrote:

>You can write a class that implements org.xml.sax.EntityResolver and
returns
>an InputSource that "points" to your local DTD copies. Pass this object to
>the SAX parser using setEntityResolver.


This seems to work provided the document in question has a document
type declaration with a system or public ID so that the
resolveEntity() method will be called. What if the document only has
an internal DTD subset, however? Or what if it has no DOCTYPE
declaration at all? If I understand this correctly, then no DTD will
be used. Is there a way I can specify DTDs for those case?


+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | [EMAIL PROTECTED] | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|                  The XML Bible (IDG Books, 1999)                   |
|              http://metalab.unc.edu/xml/books/bible/               |
|   http://www.amazon.com/exec/obidos/ISBN=0764532367/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://metalab.unc.edu/javafaq/ |
|  Read Cafe con Leche for XML News: http://metalab.unc.edu/xml/     |
+----------------------------------+---------------------------------+



Reply via email to