Along the same lines.. I have been loading well formed HTML (XHTML?)
document
<html>
<body>
</body>
</html>
using
javax.xml.parsers.DocumentBuilderFactory dbf=
javax.xml.parsers.DocumentBuilderFactory.newInstance();
javax.xml.parsers.DocumentBuilder db= dbf.newDocumentBuilder();
org.w3c.dom.Document doc = db.parse("C:\somefile.html");
but I get a SAXException on basically telling be that this entity is unknown?
Is there a way to fix that (instead of using  )? Should I point to a specific
DTD? Is that efficient?
Cheers.
"Gunnlaugur Thor Briem" <[EMAIL PROTECTED]> on 26/07/2001 16:02:57
Please respond to [EMAIL PROTECTED]
To: <[EMAIL PROTECTED]>
cc:
Subject: RE: setting entityResolver
Hi Samina,
Are you sure you need it? Do you know what you
want to use it for? It's for resolving names of
external entities used in <!DOCTYPE> declarations
and such, but it's only needed if the default way
of resolving them isn't going to work. For example
if you're referring to the DTD of an XML document
with something like
<!DOCTYPE config SYSTEM "config.dtd">
then the parser will find it if it's in the same
directory as the XML file you're parsing, and you
gave the parser an InputSource with the systemId
set. Otherwise you may need to set an EntityResolver
so that the parser can ask it for an input source
for this name (to read from it). This might be the
case, for example, if you gave the parser an
InputSource with only an InputStream or Reader ...
then the parser wouldn't know where to look for
external entities.
Hope that helps! Cheers,
- Gulli
-----Original Message-----
From: Samina Islam [mailto:[EMAIL PROTECTED]]
Sent: 26. j�l� 2001 14:51
To: [EMAIL PROTECTED]
Subject: setting entityResolver
Hi All
I'm not too sure on how to use the
void setEntityResolver(EntityResolver resolver)
method. Should I create a SAXParser first? I have already made a
entityResolver sub class.
thanks!
Samina
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]