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

Re: SAX2: Interning names in namespaces

  • From: Stefan Haustein <haustein@k...>
  • To: Terje Norderhaug <terje@i...>
  • Date: Tue, 08 Feb 2000 10:59:28 +0100

Re: SAX2: Interning names in namespaces
Terje Norderhaug wrote:

> SCRIPTERS
> 
> A "scripter" is somebody that know string manipulation and other basic
> programming used commonplace in scripts, and have some graps of the
> namespace recommendation, but don't understand pointers and the difference
> between equality vs identity on a practical level. Scripters handle

[...]

>   if (name.namespace.equals ("http://www.my.com/mynamespace")) {
>     if (name.equals ("price")) ....
>     else if (name.equals ("quantity")) .....

Adding a new field (namespace) to a final class (String) looks more like
a beginner's error than a scripter's code.
 
> PROGRAMMERS
> 
> A "programmer" understands the implications of the namespace recommendation
> and are savvy in object oriented programming. Programmers are free to use
> 
>   String myPrice = internName("http://www.my.com/mynamespace", "price");
>   String myQtyty = internName("http://www.my.com/mynamespace", "quantity");
> 
>   if (name == myPrice) ....
>   else if (name == myQtyty) ....
> 
> Under the proposal, programs that use SAX won't have to deal with namespace
> representations at runtime. Unless names are interned in namespaces,
> specialists would be limited to the less efficient techniques of beginners
> and scripters when using SAX.

Assume we have m namespaces and n elements each, and the SAX java
intering feature is activated. Your "programmers" code needs up to n*m
comparisons to find the right element. The "scripters" code
needs up to n+m comparisons only, so I would not call your "programmers"
code more efficient. 

Best regards

Stefan Haustein

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.