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

Re: bohemians, gentry


Re:  bohemians
On Thursday 05 December 2002 20:14, Joe English wrote:

> It seems to me that the "International Purchase Order" schema
> in section 4 of the W3C XML Schema Primer [1] comes close to the
> edge of that slippery slope.  While _most_ of it can be processed
> by WXS-oblivious tools, there are some tasks that can't be done
> (or can't be done easily) without a type-annotated PSVI and full
> schema information.  For instance: write a program that extracts
> all of the comments from a purchase order (see the schema fragment
> in section 4.6),   Now you could do this with an XSL transform that
> extracted all the 'ipo:shipComment' and 'ipo:customerComment'
> elements (since those are the only two elements defined to
> be of that type), but that's fragile; if the schema is extended
> to include other comment types, the transform will silently
> break. 

That's an argument *for* typing - but not done the way XSD does it!

Those two elements (shipComment and customerComment) are both comments, 
typewise. They may be other types too in a type system with inheritance, of 
course, such as 'text in language associated by nearest xml:lang' and 
'string' and so on.

Now, with type information you *can* extract all the comments, no matter what 
they are called. XSD might have you get that type information by referencing 
the XSD itself or with xsi:type, whereas the alternative is to make a 
convention that element names are type names and make sure that all comments 
are in elements called <comment> and all titles in <title> and so on.

The latter approach has problems when you want two different comments in the 
same element, though; by using the names of the children as types you remove 
the ability to give them names expressing their relationship to the parent.

There's something to be said for mechanisms like xsi:type that attach the 
typing as explicit metadata, but without requiring the loading and processing 
(according to complex rules) of a schema, in those cases...

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.