By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,462 Members | 3,388 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,462 IT Pros & Developers. It's quick & easy.

Reasoning for load-external-dtd Xerces default setting?

P: n/a
Hi,

The Xerces XML parser is reading external DTD references in DOCTYPEs
by default, but is not doing anything with them because validation is
turned off by default. This is documented in
http://xml.apache.org/xerces2-j/feat...d-external-dtd

This setting causes many XML instances with broken DTD references in
the DOCTYPE to fail and adds some performance overhead. Is there
anything good that comes from this default setting? Is an XML file
considered not well-formed if the external DTD reference is broken?

thanks,
blu
Jul 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"blu4899" <bl*****@netscape.net> wrote in message
news:42**************************@posting.google.c om...
Hi,

The Xerces XML parser is reading external DTD references in DOCTYPEs
by default, but is not doing anything with them because validation is
turned off by default. This is documented in
http://xml.apache.org/xerces2-j/feat...d-external-dtd
This setting causes many XML instances with broken DTD references in
the DOCTYPE to fail and adds some performance overhead. Is there
anything good that comes from this default setting? Is an XML file
considered not well-formed if the external DTD reference is broken?


I can't find anywhere in the XML spec that says it is. If someone knows
better, I would be delighted to know about it, too.

Bob Foster
Jul 20 '05 #2

P: n/a
But, I hasten to add, all parsers I am aware of treat it an unresolvable DTD
URI as an error if validation is enabled (while only some treat an
unresolvable external entity URI as an error).

Tim Bray, in his Annotated XML comments had this to say about URIs: "If you
do something silly like using an empty identifier, or one that doesn't work,
anyone to whom you send the document has every right to complain that it's
broken."

Makes sense. But this doesn't seem to have found its way into the spec.

Bob Foster

"blu4899" <bl*****@netscape.net> wrote in message
news:42**************************@posting.google.c om...
Hi,

The Xerces XML parser is reading external DTD references in DOCTYPEs
by default, but is not doing anything with them because validation is
turned off by default. This is documented in
http://xml.apache.org/xerces2-j/feat...d-external-dtd
This setting causes many XML instances with broken DTD references in
the DOCTYPE to fail and adds some performance overhead. Is there
anything good that comes from this default setting? Is an XML file
considered not well-formed if the external DTD reference is broken?

thanks,
blu

Jul 20 '05 #3

P: n/a

"Bob Foster" <bo********@comcast.net> wrote in message news:wmplb.839537$YN5.950633@sccrnsc01...
"blu4899" <bl*****@netscape.net> wrote in message
news:42**************************@posting.google.c om...
Hi,

The Xerces XML parser is reading external DTD references in DOCTYPEs
by default, but is not doing anything with them because validation is
turned off by default. This is documented in

http://xml.apache.org/xerces2-j/feat...d-external-dtd

This setting causes many XML instances with broken DTD references in
the DOCTYPE to fail and adds some performance overhead. Is there
anything good that comes from this default setting? Is an XML file
considered not well-formed if the external DTD reference is broken?


I can't find anywhere in the XML spec that says it is. If someone knows
better, I would be delighted to know about it, too.


Not validating does not mean that the parser should not read external entities.
These can contain entity declarations and attribute default values which the
parser can use to resolve entity references and default attributes properly.

Karl
Jul 20 '05 #4

P: n/a
"Karl Waclawek" <ka**@waclawek.net> wrote in message
news:aO*********************@nnrp1.uunet.ca...
"blu4899" <bl*****@netscape.net> wrote in message
news:42**************************@posting.google.c om...
Hi,

The Xerces XML parser is reading external DTD references in DOCTYPEs
by default, but is not doing anything with them because validation is
turned off by default. This is documented in
http://xml.apache.org/xerces2-j/feat...d-external-dtd

This setting causes many XML instances with broken DTD references in
the DOCTYPE to fail and adds some performance overhead. Is there
anything good that comes from this default setting? Is an XML file
considered not well-formed if the external DTD reference is broken?


I can't find anywhere in the XML spec that says it is. If someone knows
better, I would be delighted to know about it, too.


Not validating does not mean that the parser should not read external

entities. These can contain entity declarations and attribute default values which the parser can use to resolve entity references and default attributes

properly.

One can pile up "should" and "can" as high as one likes, but a parser won't
do any of the things it should or can do unless it a) supports the option to
do them and b) is appropriately configured. ;-}

Bob Foster
Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.