|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: XML Schemas: Best Practices
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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








