[Home] [By Thread] [By Date] [Recent Entries]

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

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.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member