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

RE: XML Schemas: Best Practices

  • From: "Arnold, Curt" <Curt.Arnold@h...>
  • To: "'xml-dev@l...'" <xml-dev@l...>
  • Date: Tue, 09 Jan 2001 10:21:15 -0700

xml schema abstract substitution subclass
Abstract type and type substitution does seem to work well as long as you only have one level of abstraction and only want to work on the top-level.  In this case, it has some of the advantages of the
aggregation pattern that would have expressed the instance as:

<Publication>
	<Magazine>Mag Specific Stuff</Magazine>
	Generic Publication Content
</Publication>

Both give you some artifact in the instance that you can identify and query an element as both a Publication and a Magazine with current technologies.

Unfortunately, the type substitution approach doesn't give you a clean way of expressing in the instance a deeper hierarchy in a way that existing processors like XSLT can make meaningful queries.
Also, since the xsi:type value is a QName, unless you are restricting your document to use a fixed prefix, it would be difficult to write an XPath that would give you only the  Magazine nodes.

I don't think the superclass as tag name, subclass as xsi:type pattern is generic enough to be a best practice.  The aggregation pattern offers the same advantages but is more capable.

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.