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

Re: Parsing efficiency? - why not 'compile'????


in efficiency of xsd
On Thursday 27 February 2003 15:26, Elliotte Rusty Harold wrote:
> At 2:39 PM +0000 2/27/03, Alaric B. Snell wrote:
> >No, no, relax; in the scheme I suggested, it uses the type information as
> >*advisory* data on how to encode stuff. It could ignore it all and just
> > put everything in as strings. This is what people refer to as a
> > "Schema-aware compressor".
>
> I'm not sure what you're suggesting is what Robin's suggesting. Right
> now I'm very confused (not that unusual or even unproductive a state
> to be in, though :-)
>
> Type-awareness strikes me as fundamentally dangerous, especially in
> this sort of scheme. Yes, it could encode everything as strings but
> given that it doesn't, how do I decode? Do I have to have the schema
> handy? or is the type information bundled into the binary file?

I'd recommend the latter.

> Also, how are elements like these encoded?

In the scheme I suggested for schema-shy people:

> <quantity type="xsd:int">000017</quantity>

int:17

> <quantity type="xsd:int">17.00000</quantity>

int:17

> <quantity type="xsd:int">17.5</quantity>

string:17.5, or an error if it's been told to validate

> <quantity type="xsd:int">two</quantity>

string:two, or an error if...

> <quantity type="xsd:int">2 and not a fnord</quantity>

string:2 and not..., or an error if...

> <quantity type="xsd:int>Cheesy Poofs</quantity>

string:Cheesy Poofs, or an error if...

But personally I'm not schema-shy; if I declare that something needs to be an 
integer and somebody tries to write "five" in there, that will either be 
resolved in the UI and the integer '5' written, or an error thrown early on 
rather than letting bad data propogate. But that's just a personal feeling.

I guess you're a Perl/Python/TCL type guy rather than a Java/C/Pascal one? :-)

ABS

-- 
A city is like a large, complex, rabbit
 - ARP

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.