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

Re: Fast text output from SAX?


Re:  Fast text output from SAX?
At 9:00 AM -0400 4/16/04, Stephen D. Williams wrote:

>Binary doesn't imply there isn't any well-formedness checking, obviously.

For once I agree. Obviously, binary doesn't imply that. However, in 
practice, the binary formats I do see rarely do as much 
well-formedness checking as a parser does, either in the XML domain 
or elsewhere. Speed gains that come from eliminating well-formedness 
checking should not be attributed to a binary format. Similar gains 
can be had by eliminating well-formedness checking when processing 
real XML (Not that I recommend doing that of course).

>Incremental, or lazy evaluation, well-formedness is useful and 
>potentially protects applications just as well as full 
>well-formedness with better efficiency.

Simply not true. It doesn't come close to protecting applications as 
well as full checking.

>Allowing the application the option of avoiding repetitive or 
>unncessary well-formedness checking is a valid strategy.  Your 
>argument that data that a 'program' receives must always be fully 
>validated in any situation could just as easily be extended to 
>libraries and modules receiving DOM references or similar.  What one 
>system may do with libraries or software modules, another may do 
>with plugins and another may do with n-tier processing steps.  Does 
>the granularity of the implementation somehow necessarily change the 
>fundamental likelihood of corruption?

All published interfaces should verify their preconditions. Libraries 
should (and indeed the ones I write do) verify that input passed to 
them from outside the library is correct. For instance, if I publish 
an interface that expects a DOM object that can be serialized as 
namespace well-formed XML, and you pass me a DOM object that can't 
be, then the precondition is violated. The method should detect this 
and throw an exception. And indeed this is exactly what I do:

http://www.cafeconleche.org/XOM/apidocs/nu/xom/converters/DOMConverter.html#convert(org.w3c.dom.Document)

Cowboy coding like you suggest scares me. I certainly wouldn't want 
to have to trust any software written to such standards. Regrettably 
I know there's a lot of such software out there, which is more reason 
than ever for my software to be very careful about what it receives 
from your software.
-- 

   Elliotte Rusty Harold
   elharo@m...
   Effective XML (Addison-Wesley, 2003)
   http://www.cafeconleche.org/books/effectivexml            
   http://www.amazon.com/exec/obidos/ISBN%3D0321150406/ref%3Dnosim/cafeaulaitA 

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.