XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Substituting elements in a group for the group whenredefining

Hi Allison,

Xerces is happy with this equivalent model:

<xs:restriction base="ev:PublicEventContactType">
     <xs:sequence>
         <xs:sequence/>
         <xs:sequence minOccurs="0">
             <xs:element ref="ev:ContactName" minOccurs="0"/>
             <xs:element ref="ev:ProfessionalAffiliations" minOccurs="0"/>
             <xs:element ref="ev:Phones" minOccurs="0"/>
             <xs:element ref="ev:EmailAddresses" minOccurs="0"/>
             <xs:element ref="ev:Addresses" minOccurs="0"/>
             <xs:element ref="ev:PreferredContactMethod" minOccurs="0"/>
         </xs:sequence>
     </xs:sequence>
</xs:restriction>

The algorithm for determining if a type is a valid restriction of other 
type as described in the spec is complicated and does not match always 
what the intuition tells you that is a valid restriction.
XSV and Saxon AFAIK implement a better algorithm for checking 
restrictions, [1] I believe. This new algorithm probably will be 
specified in XML Schema 1.1 - I think some people on the list can 
confirm/infirm that.

[1] http://www.ltg.ed.ac.uk/~ht/XML_Europe_2003.html

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


Allison Bloodworth wrote:
> Hi, 
> 
> I tried to search the archives at http://lists.xml.org/archives/xml-dev/ on
> this but got a message saying: The requested URL /cgi-bin/htsearch was not
> found on this server. I also did a search of the internet but unfortunately
> am having trouble finding info on this situation the XML Schema spec.
> 
> I would like to redefine an element (PublicEventContactType) that is defined
> in a schema as containing a group called ContactInfo. I don't want to
> redefine the group itself, as those changes would apply to a lot of other
> elements where I don't want the change made, but just within this
> PublicEventContactType element itself. You would think that this would be
> something that XML Schema would support, but I am getting an error message
> from XML Spy 2005 saying, "The content model of complex type
> 'ev:PublicEventContactType' is not a valid restriction of the content model
> of complex type 'ev:PublicEventContactType' and a similar error in Oxygen
> 6.2. 
> 
> Is this really not possible? You would think I could substitute the elements
> in the group for the group in the redefine...I do understand that I could
> remove them here and put them back in in an extension, but that would
> require another schema.
> 
> Original:
> 	<xs:group name="ContactInfo">
> 		<xs:sequence>
> 			<xs:element ref="ev:ContactName" minOccurs="0"/>
> 			<xs:element ref="ev:ProfessionalAffiliations"
> minOccurs="0"/>
> 			<xs:element ref="ev:Phones" minOccurs="0"/>
> 			<xs:element ref="ev:EmailAddresses" minOccurs="0"/>
> 			<xs:element ref="ev:Addresses" minOccurs="0"/>
> 			<xs:element ref="ev:WebPages" minOccurs="0"/>
> 			<xs:element ref="ev:PreferredContactMethod"
> minOccurs="0"/>
> 		</xs:sequence>
> 	</xs:group>
> 	<xs:complexType name="PublicEventContactType">
> 		<xs:sequence>
> 			<xs:element ref="ev:PublicEventContactID"
> minOccurs="0"/>
> 			<xs:group ref="ev:ContactInfo" minOccurs="0"/>
> 			<xs:element ref="ev:PublicEventContactTypes"
> minOccurs="0"/>
> 			<xs:element ref="ev:PublicEventContactParentID"
> minOccurs="0">
> 		</xs:sequence>
> 	</xs:complexType>
> 
> Redefine:
> 		<xs:complexType name="PublicEventContactType">
> 			<xs:complexContent>
> 				<xs:restriction
> base="ev:PublicEventContactType">
> 					<xs:sequence>
> 						<!-- REMOVING THIS ELEMENT
> <xs:element ref="ev:PublicEventContactID" minOccurs="0"/> -->
> 						<xs:element
> ref="ev:ContactName" minOccurs="0"/>
> 						<xs:element
> ref="ev:ProfessionalAffiliations" minOccurs="0"/>
> 						<xs:element ref="ev:Phones"
> minOccurs="0"/>
> 						<xs:element
> ref="ev:EmailAddresses" minOccurs="0"/>
> 						<xs:element
> ref="ev:Addresses" minOccurs="0"/>
> 						<!-- REMOVING THIS ELEMENT
> <xs:element ref="ev:WebPages" minOccurs="0"/> -->
> 						<xs:element
> ref="ev:PreferredContactMethod" minOccurs="0"/>
> 						<!-- REMOVING THIS ELEMENT
> <xs:element ref="ev:PublicEventContactTypes" minOccurs="0">
> 						</xs:element> -->
> 						<!-- REMOVING THIS ELEMENT
> <xs:element ref="ev:PublicEventContactParentID" minOccurs="0">
> 						</xs:element> -->
> 					</xs:sequence>
> 				</xs:restriction>
> 			</xs:complexContent>
> 		</xs:complexType> 
> 
> Thanks for your help,
> 
> Allison Bloodworth
> Principal Administrative Analyst
> Technology Program Office
> University of California, Berkeley
> (415) 377-8243
> abloodworth@berkeley.edu
> 
> 
> 
> 
> _______________________________________________________________________
> 
> XML-DEV is a publicly archived, unmoderated list hosted by OASIS
> to support XML implementation and development. To minimize
> spam in the archives, you must subscribe before posting.
> 
> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
> Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
> subscribe: xml-dev-subscribe@lists.xml.org
> List archive: http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
> 


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


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

Copyright 1993-2007 XML.org. This site is hosted by OASIS