OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: SAX2: Interning names in namespaces

[ Lists Home | Date Index | Thread Index ]
  • From: Stefan Haustein <haustein@kimo.cs.uni-dortmund.de>
  • To: Terje Norderhaug <terje@in-progress.com>
  • Date: Tue, 08 Feb 2000 10:59:28 +0100

Terje Norderhaug wrote:

> 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.
> 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


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS