[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: JSR 206 and SAX


progress sax parser raising errors
/ "Jeff Rafter" <lists@j...> was heard to say:
| Define problem. If the feature is not supported or not recognized the
| appropriate SAXException should be raised during the call to getFeature.

> Yep.

| Unfortunately, in this proposal there is nothing per se about what to do
| when the document is or is not full normalized. Perhaps Locator2 needs

> My thinking was that if the document wasn't normalize, an error would
> be raised. If the parse finishes without raising an error, it's
> normalized.

| Additionally, I would question whether or not a feature should be provided
| for normalization transcoding or if that was beyond the scope of SAX. I

> I think that's application-level functionality that belongs in a layer
> above SAX.

I am not sure I comfortable elevating this to error status. At best, I would
think this would be a warning() because it is a purely process oriented
problem-- i.e., you simply can't do a byte for byte unicode comparisson-- 
this isn't an error, you should simply be warned about the inability to
perform the test.

Secondly, this is something which in a non-normalized document will possibly
occur a lot. This would create a lot of noise in an error listing-- and
likewise for a listing of errors+warnings in the document as many editors
do. Additionally, the repetition of the non-normalized warning/error means
creating a new SAXParseException *every* time. This goes back to a
conversation Karl Waclawek and I have been having off list about the
performance penalties involved in the current design-- but that is probably
a discussion for another time...

I think we need to have a defined scenario/use case for how the information
will actually be used before it is finalized. e.g., when such a
warning/error would occur, what an ideal line number and column position
would be, what the order of events would be when the processor encountered
such a warning. Should the warning be fired for every instance of
non-full-normalization? If not, what is the benefit to using the
ErrorHandler at all instead of a single check for isFullyNormalized? When
multiple errors/warnings occur (e.g. one for each occurence of
non-full-normalization, there is great ambiguity:

e.g. This is somewhat clear:

  [startElement]
  [startElement]
  [warning non-nomalized text]
  [characters]

while this is not:

  [warning non-nomalized text]
  [startElement]

When the element name is non-nomalized? When the attribute name is non
normalized? When the attribute content is non-normalized?

What about:

  [warning non-nomalized text]
  [startPrefixMapping]
  [startElement]

Again, it is difficult to determine where exactly the warning should be
applied. Does it matter?

Best Regards,
Jeff Rafter


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.