OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] Two quick questions regarding restriction in XML Schema

[ Lists Home | Date Index | Thread Index ]

Hey Murali, 
  You just brought up something that has been at the back of my mind about the XQuery Formal Semantics. Although I haven't read it completely, there seems to be a complication in that part of its type system seems to be based on that used by XDuce and another part is based on W3C XML Schema when as you have shown they are contradictory in a number of ways. 
 
Thanks for reminding me to take a closer look at this. 

	-----Original Message----- 
	From: Murali Mani [mailto:mani@CS.UCLA.EDU] 
	Sent: Wed 5/22/2002 1:07 PM 
	To: Dare Obasanjo 
	Cc: Nada Reinprecht; xml-dev@lists.xml.org 
	Subject: RE: [xml-dev] Two quick questions regarding restriction in XML Schema
	
	


	Let me explain the kind of contradictions possible --
	
	Let me first introduce tree types, and hedge types. Tree types produce
	trees, and hedge types produce hedges (where hedge is an ordered list of
	trees).
	
	Example of tree type is
	Book -> book (Title, Author*)
	
	Example of hedge type is (Title, Author*)
	
	In XML-Schema "effectively", subtyping is defined on the basis of hedge
	types.
	
	For example consider hedge type H1 -> (Title, Author*)
	and hedge type H2 -> (Title, Author, Author)
	
	Now consider a function which takes a parameter an object of type H1 and
	returns nothing, which is defined as say:
	F : H1 -> null
	
	Now one contradiction is: Suppose we call the function F as
	F (o:H2) -- that is we call F with an object o of type H2.. Is this
	valid?? In other words does this statement type check correctly when we
	compile??
	
	There are two possible solutions, because any hedge produced by H2 will
	also be of type H1, so it is fine... -- this is what is done when
	subtyping for XML is what I would call "Implicit subtyping based on
	inclusion" -- this is XDuce.
	
	The other is no -- because H2 is not declared as a subtype of H1.. This is
	how it is done in XML Schema.
	
	The good thing is subtyping defined in XML Schema does not seem to have
	"problems" in whatever sense, but the question is whether that is the way
	subtyping should be defined in the first place... and what other options
	are there..
	
	cheers and regards - murali.
	
	On Thu, 16 May 2002, Dare Obasanjo wrote:
	
	> As for the question on using block for restriction which I assume means
	> using the block attribute on a complexType definition, the answer is
	> that you'd block restriction to prevent types derived by restriction
	> from replacing the content model of base types in an instance document.
	>
	> This is also described in the XML Schema Primer in
	> http://www.w3.org/TR/xmlschema-0/#ref28
	>
	> --
	> PITHY WORDS OF WISDOM
	> Experience is something you don't get until just after you need it.
	>
	> This posting is provided "AS IS" with no warranties, and confers no
	> rights.
	> You assume all risk for your use. (c) 2002 Microsoft Corporation. All
	> rights reserved.
	>
	>
	>
	> > -----Original Message-----
	> > From: Nada Reinprecht [mailto:Nada_Reinprecht@nemmco.com.au]
	> > Sent: Thursday, May 16, 2002 4:04 PM
	> > To: Murali Mani
	> > Cc: xml-dev@lists.xml.org
	> > Subject: Re: [xml-dev] Two quick questions regarding
	> > restriction in XML Schema
	> >
	> >
	> >
	> > Muralli,
	> >
	> > a) You do not need to use xsi:type in the document if you
	> > derive the type by restriction. In the schema you can simply
	> > associate the derived type with an element.
	> >
	> > However, if you want to implement alternative contents for
	> > the same element, than you use the xsi:type which allows you
	> > to specify desirable content in each document.
	> >
	> > Cheers,
	> >
	> > </nada>
	> >
	> >
	> >
	> >
	> >
	> >                     Murali Mani
	> >
	> >                     <mani@CS.UCLA        To:
	> > <xml-dev@lists.xml.org>
	> >                     .EDU>                cc:
	> >
	> >                                          Subject:
	> > [xml-dev] Two quick questions regarding
	> >                     17/05/02             restriction in XML
	> > Schema
	> >                     02:42
	> >
	> >
	> >
	> >
	> >
	> >
	> >
	> >
	> >
	> > I think these are related.. Can someone tell me --
	> >
	> > a) If we derive types by restriction, do we have to use
	> > xsi:type in the document? Is it true if I say that the
	> > document will be valid irrespective of whether we use
	> > xsi:type or not .. We use xsi:type to know the "precise" type??
	> >
	> > b) Is there any point in using block for restriction
	> >
	> > thanks and regards - murali.
	> >
	> >
	> > -----------------------------------------------------------------
	> > The xml-dev list is sponsored by XML.org
	> > <http://www.xml.org>, an initiative of OASIS
	> <http://www.oasis-open.org>
	>
	> The list archives are at http://lists.xml.org/archives/xml-dev/
	>
	> To subscribe or unsubscribe from this list use the subscription
	> manager: <http://lists.xml.org/ob/adm.pl>
	>
	>
	>
	>
	>
	>
	> ------------------------------------------
	> This e-mail is confidential.  If you are not the intended recipient, any
	> use, disclosure or copying of this document is unauthorised and
	> prohibited.  If you have received this document in error, please delete
	> the email and notify me by return email or by phoning the NEMMCO
	> Helpdesk on 1300 300 295.
	>
	> -----------------------------------------------------------------
	> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
	> initiative of OASIS <http://www.oasis-open.org>
	>
	> The list archives are at http://lists.xml.org/archives/xml-dev/
	>
	> To subscribe or unsubscribe from this list use the subscription
	> manager: <http://lists.xml.org/ob/adm.pl>
	>
	
	
	
	





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS