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

RE: xsi:type and broken contracts

  • To: "Michael Leditschke" <mike@a...>
  • Subject: RE: xsi:type and broken contracts
  • From: "Dare Obasanjo" <dareo@m...>
  • Date: Sat, 8 Jun 2002 03:47:15 -0700
  • Cc: <xml-dev@l...>
  • Thread-index: AcIOzG+TcI2m1ShDQj2MSS1gxMzE9wADQS/6
  • Thread-topic: xsi:type and broken contracts

governmentemployee
The code doesn't have to be part of a library, it could just be code that manipulates documents coming in from external sources. The fact is that the combination of xsi:schemaLocation and xsi:type make it very likely that a type aware application will come across derived types in instance documents unless these attributes are specifically mandated against. 

	-----Original Message----- 
	From: Michael Leditschke [mailto:mike@a...] 
	Sent: Sat 6/8/2002 2:11 AM 
	To: Dare Obasanjo 
	Cc: xml-dev@l... 
	Subject: RE:  xsi:type and broken contracts
	
	

	> You can process on the basis of the type of the element. For instance I
	> can process all myns:Employee elements off type myns:EmployeeType.
	> However a valid instance can use xsi:type to assert its type to that of
	> a derived type in another schema which I the original author of the
	> processing code knows nothing about.
	
	OK. Its a valid instance, which implies its got a PSVI that's been built
	from a schema that references the type the code knows "nothing" about. Yes?
	
	So your code is something like a library, being used as part of a system
	designed by someone else, who has extended the original schema you
	designed for to include new types as you suggest below?
	
	
	> The saving grace which I pointed out and Henry Thompson agreed with is
	> that derived types cannot radically alter the content model due to how
	> restriction and extension work. So even though elements that assert
	> their types as foo:MicrosoftEmployee, bar:GovernmentEmployee, etc show
	> up in the instance document when I expected myns:EmployeeType types, my
	> code should still be able to handle them since they are derived types
	> and will have similar structure and content.
	
	Understood. If restriction, you should already handle the more open
	constraints of the myns:EmployeeType; if extension, you'll ignore the
	extra stuff.
	
	
	>
	> PS: CCing XML-DEV since this is relevant discussion that could do with
	> public consumption.
	
	As you wish.
	
	Regards
	Michael
	
	


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.