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

Re: Namespaces,W3C XML Schema (was Re: ANN: SAX FiltersforNamespaceProce

  • From: Elliotte Rusty Harold <elharo@m...>
  • To: Xml-Dev <xml-dev@l...>
  • Date: Thu, 23 Aug 2001 09:40:12 -0400

public namespaces
At 8:41 AM +0100 8/23/01, Francis Norton wrote:
>Elliotte Rusty Harold wrote:

>> Why would local types make life harder for general purpose processors? If a presentation or editing tool is presented with a local restriction of a type, why can't it work with that? If it can't work with that, why can't it use an editor for the base type?
>
>Hi, that was me. I may be misunderstanding your point - two
>locally-typed elements in the same schema may have the same name but
>totally different types, with no relationship by restriction to anything
>in common, or at all (apart from our old friend the ur-type). 
>

I still don't see the problem. Assume we have two elements named FOO and FOO. FOO in context 1 has type Str32 (a string with exactly 32 characters). FOO in context2 however, has type int. Both are passed to a processing layer through some PSVI aware API. When the processor receives FOO it is told the name and type of the element. It dispatches appropriately for the type. It doesn't matter which type it is. FOO Str32s are dispatched to the FOO Str32 handler. FOO ints are dispatched to the FOO int handler. Where's the problem? 

In fact, this even reminds me a little of method overloading where you often do have two methods with the same names and even the same argument lists but different argument types. For instance here's one I wrote recently:

public XIncludeFilter(String url) 
public XIncludeFilter(URL url)

There may be a problem for non-PSVI aware APIs, so I wouldn't necessarily recommend that applications be designed like this. However, even in that case, there's likely extra-context information (like what the parent element is) that allows the program to sort out the details. In fact, the only real objection I see to this is that it's more confusing for humans to sort out what's going on, but this is nothing to a computer. 
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo@m... | Writer/Programmer |
+-----------------------+------------------------+-------------------+ 
|          The XML Bible, 2nd Edition (Hungry Minds, 2001)           |
|              http://www.ibiblio.org/xml/books/bible2/              |
|   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      | 
|  Read Cafe con Leche for XML News: http://www.ibiblio.org/xml/     |
+----------------------------------+---------------------------------+

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.