Re: [Sax-devel] Attribute values with unresolved entities
Brought to you by:
dmegginson
From: Michael G. <mrg...@ca...> - 2004-04-25 23:25:28
|
sax...@li... wrote on 04/25/2004 06:15:08 PM: > At 3:55 PM -0400 4/25/04, Michael Glavassevich wrote: > > The XML spec also says: "It is an *error* for a fragment identifier > (beginning with a # character) to be part of a system identifier." > What is an error? The spec defines it as: "a violation of the rules > of this specification; results are undefined. Unless otherwise > specified, failure to observe a prescription of this specification > indicated by one of the keywords MUST, REQUIRED, MUST NOT, SHALL and > SHALL NOT is an error. Conforming software MAY detect and report an > error and MAY recover from it." [1] The spec doesn't compel a parser > to detect errors (besides violations of validity constraints, > reported at user option), nor does it specify how a parser recovers > if it chooses to. > > > However, the SAX spec says that such errors correspond to calls to > the error() method in the registered ErrorHandler, if any. I think it > should be reported if the user has installed an error handler. > Silently throwing away data is a bad thing. The javadoc for error() refers to the definition of *error* in the XML spec, which doesn't require that they be reported, except at user option and only for validity constraints. The XML spec is clear that reporting this error is not mandatory. SAX doesn't say that parsers are required to report all errors defined in the XML spec to error() just by virtue of registering an ErrorHandler. I think it only imposes the more modest requirement that if an error is reported to an ErrorHandler which corresponds to the definition of 'error' in the XML spec, it must be reported to error(). Validity constraint violations are reported to the error() method when the validation feature is true. Unicode normalization errors will be reported to the error() method when the unicode-normalization-checking feature is true. Perhaps this should be under control of a feature for parsers which support reporting such errors. > -- > > Elliotte Rusty Harold > el...@me... > Effective XML (Addison-Wesley, 2003) > http://www.cafeconleche.org/books/effectivexml > http://www.amazon.com/exec/obidos/ISBN%3D0321150406/ref%3Dnosim/cafeaulaitA > > > ------------------------------------------------------- > This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek > For a limited time only, get FREE Ground shipping on all orders of $35 > or more. Hurry up and shop folks, this offer expires April 30th! > http://www.thinkgeek.com/freeshipping/?cpg=12297 > _______________________________________________ > List: sax-devel, sax...@li... > See: http://www.saxproject.org/ > https://lists.sourceforge.net/lists/listinfo/sax-devel Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: mrg...@ca... E-mail: mrg...@ap... |