At 09.21 27/12/2006 -0500, Jacinto, Alex wrote:
Alberto,
What does "setLoadExternalDTD(false)" provide me? From what I
understand from the FAQ, this is an alternative to overloading the
entity resolver.
setLoadExternalDTD does just what it says, it allows to skip the
loading of the external DTD; the internal DTD is always processed,
and external entity references are always expanded (the latter can be
controlled by plugging in a SecurityManager, but using this will
cause a runtime error to be reported).
Alberto
Thanks for the quick reply.
Alex
-----Original Message-----
From: Alberto Massari [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 27, 2006 9:02 AM
To: [email protected]
Subject: Re: External DTD
Hi Alex,
At 08.27 27/12/2006 -0500, Jacinto, Alex wrote:
>Hello,
>
>I am trying to avoid the loading of external DTD. According to the
>FAQ, I only need to: 1. Set my validation scheme to never
>2. Set load external DTD to false
>
>Like so . . .
>
>parser->setValidationScheme (XercesDOMParser::Val_Never);
>parser->setLoadExternalDTD (false);
Even if the validation scheme is set to never, DTD will be processed
to define the entities; and your internal DTD defines the
NskBasicText.dtd entity that is later expanded to load the
"../DTD/NskBasicText.dtd" file.
If you want to prevent Xerces from loading those files too, you
should create an entity resolver and return an empty content when
requested (see the Redirect sample).
>However, my parser still spit out an XMLPlatformException, a fatal
>error with message: "Could not close the file"
By chance, are you running on Solaris? This looks similar to
http://issues.apache.org/jira/browse/XERCESC-1658
Alberto
>I'm using 2.7 and here is a sample of xml file:
>
><?xml version="1.0" encoding="UTF-8" ?>
><!DOCTYPE NewsML SYSTEM "../DTD/NewsMLv1.0.dtd" [<!ENTITY %
>NskBasicText.dtd SYSTEM "../DTD/NskBasicText.dtd">
>%NskBasicText.dtd;]>
>
><NewsML>
></NewsML>
>
>I do not have the mentioned DTD files in my local computer.
>
>Thanks in advance and happy holidays.
>
>
>Alex