Reasoning for load-external-dtd Xerces default setting?

Discussion in 'XML' started by blu4899, Oct 22, 2003.

  1. blu4899

    blu4899 Guest

    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/features.html#nonvalidating.load-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
     
    blu4899, Oct 22, 2003
    #1
    1. Advertising

  2. blu4899

    Bob Foster Guest

    "blu4899" <> wrote in message
    news:...
    > 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/features.html#nonvalidating.load-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
     
    Bob Foster, Oct 22, 2003
    #2
    1. Advertising

  3. blu4899

    Bob Foster Guest

    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" <> wrote in message
    news:...
    > 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/features.html#nonvalidating.load-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
     
    Bob Foster, Oct 22, 2003
    #3
  4. "Bob Foster" <> wrote in message news:wmplb.839537$YN5.950633@sccrnsc01...
    > "blu4899" <> wrote in message
    > news:...
    > > 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/features.html#nonvalidating.load-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
     
    Karl Waclawek, Oct 31, 2003
    #4
  5. blu4899

    Bob Foster Guest

    "Karl Waclawek" <> wrote in message
    news:aOyob.98486$...
    > > "blu4899" <> wrote in message
    > > news:...
    > > > 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/features.html#nonvalidating.load-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
     
    Bob Foster, Oct 31, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Manuel Yguel

    external dtd or schema with xerces ?

    Manuel Yguel, Feb 19, 2004, in forum: XML
    Replies:
    0
    Views:
    515
    Manuel Yguel
    Feb 19, 2004
  2. Andy Baker

    Reasoning behind nested scope

    Andy Baker, Aug 3, 2004, in forum: Python
    Replies:
    6
    Views:
    340
    Nigel Rowe
    Aug 5, 2004
  3. Rick Spencer

    what's wrong with my popen reasoning?

    Rick Spencer, Feb 5, 2006, in forum: Python
    Replies:
    1
    Views:
    344
    Rick Spencer
    Feb 5, 2006
  4. Sjoerd Mullender
    Replies:
    2
    Views:
    353
    Sjoerd Mullender
    Feb 13, 2008
  5. GHUM
    Replies:
    1
    Views:
    270
    Marc 'BlackJack' Rintsch
    Oct 17, 2008
Loading...

Share This Page