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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: 25 Feb Structures Questions/Restriction

[ Lists Home | Date Index | Thread Index ]
  • From: "Arnold, Curt" <Curt.Arnold@hyprotech.com>
  • To: "'ht@cogsci.ed.ac.uk'" <ht@cogsci.ed.ac.uk>
  • Date: Fri, 10 Mar 2000 10:08:01 -0700

Henry Thompson wrote:

>The new design for complex type definition by restriction is that you
>supply a complete type definition which you _assert_ is a restriction, 
>and this is checked at schema processing time.  No copying from the
>base type definition is performed.  This is different from simple type 
>definition by restriction, were unmentioned facets _are_ copied down, as 
>it were.

My initial impression was that that would be more complex than the
XPath-ish proposal.  What took a few seconds to dawn on me was 
the restriction type definition may not need to be as complex 
as the base type definition.  It only has to be specific enough 
so that the undesired content is not legal for the restriction type.

Something like:

<type name="type1" source="reallyComplexBaseType">
	<element ref="element1" minOccur="0"/>
	<element ref="element2" minOccur="0"/>
	<element ref="element3" minOccur="0"/>
</type>

To make element2 required:

<type name="type2" base="type1">
	<restrict>
		<type>
			<any exclude="element2" minOccur="0" maxOccur="*"/>
			<element ref="element2" minOccur="1"/>
			<any/>
		</type>
	</restrict>
</type>

To make element2 prohibited:			

<type name="type2" base="type1">
	<restrict>
		<type>
			<any exclude="element2" minOccur="0" maxOccur="*"/>
		</type>
	</restrict>
</type>


I think that you would need to give any and anyAttribute
and exclude attribute that is a list of qnames and you are home.
The parser is required to validate that the content is valid
both for the base type and the restriction type.


***************************************************************************
This is xml-dev, the mailing list for XML developers.
To unsubscribe, mailto:majordomo@xml.org&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/
***************************************************************************




 

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

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