Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: Changing the type of an attribute

From: "Priscilla Walmsley" <priscilla@--------.--->
To: "'Hans Teijgeler'" <hans.teijgeler@--------.-->, "'xml-schema, developers-forum'" <xmlschema-dev@--.--->
Date: 1/3/2005 5:26:00 AM
Hello Hans,

When you restrict a complex type and change the type of an attribute, that
new type must be a restriction (directly or indirectly) of the base type.
In your case, any-enumerated_set_of_class is not derived from any-thing.
They are both derived from idref_pattern, so they are "siblings" in the
derivation chain.

Is there any reason you can't make any-enumerated_set_of_class a restriction
of any-thing?

Hope that helps,
Priscilla 

-----------------------------------------------------
Priscilla Walmsley             priscilla@w...
Author, Definitive XML Schema     (Prentice Hall PTR)
-----------------------------------------------------  

> -----Original Message-----
> From: xmlschema-dev-request@w... 
> [mailto:xmlschema-dev-request@w...] On Behalf Of Hans Teijgeler
> Sent: Friday, December 31, 2004 5:01 AM
> To: xml-schema, developers-forum
> Cc: thompson, henry
> Subject: Re: Changing the type of an attribute
> 
> Folks,
> 
> I sent this request for help ten days ago, but unfortunately 
> got no reaction
> whatsoever.
> 
> Can anybody help?
> 
> regards,
> Hans
> 
> ==============================
> 
> Hans Teijgeler wrote:
> 
> > Folks,
> >
> > Below are the snippets of a schema that are relevant to a 
> problem I stumbled
> > across.
> >
> > I validated this schema against XSV and got the following error:
> >
> > file:///usr/local/XSV/xsvlog/tmpchD_tWuploaded:2265:5: 
> Invalid: restricting
> > attribute with type
> > {http://www.tc184-s
> > 4.org/iso15926-7/datamodel/2005-1.xsd}any-enumerated_set_of_class
> >
> > not derived from declared base's attribute's type
> > {http://www.tc184-sc4.org/iso15926-7/datamodel/2005-1.xsd{any-thing}
> >
> > The code snippets are:
> >
> >         <xs:simpleType name="id_pattern">
> >                 <xs:restriction base="xs:NMTOKEN">
> >                         <xs:pattern
> > 
> value="([a-zA-Z][a-zA-Z0-9]__)*[a-zA-Z0-9\.\-]+(&#x00B7;[a-zA-
> Z0-9\.\-]+)?"/>
> >                 </xs:restriction>
> >         </xs:simpleType>
> >         <xs:simpleType name="idref_pattern">
> >                 <xs:restriction base="xs:NMTOKEN">
> >                         <xs:pattern
> > 
> value="([a-zA-Z][a-zA-Z0-9]__)*[a-zA-Z0-9\.\-]+(&#x00B7;[a-zA-
> Z0-9\.\-]+)?"/>
> >                 </xs:restriction>
> >         </xs:simpleType>
> >         <!--=====================-->
> >         <xs:complexType name="thing" abstract="true">
> >                 <xs:attribute name="id" type="id_pattern" 
> use="required"/>
> >         </xs:complexType>
> >         <xs:simpleType name="any-thing">
> >                 <xs:restriction base="idref_pattern"/>
> >         </xs:simpleType>
> >         <!--=====================-->
> >         <xs:complexType name="class">
> >                 <xs:complexContent>
> >                         <xs:extension base="thing"/>
> >                 </xs:complexContent>
> >         </xs:complexType>
> >         <xs:simpleType name="any-class">
> >                 <xs:restriction base="idref_pattern"/>
> >         </xs:simpleType>
> >         <!--=====================-->
> >         <xs:complexType name="enumerated_set_of_class">
> >                 <xs:complexContent>
> >                         <xs:extension base="class_of_class"/>
> >                 </xs:complexContent>
> >         </xs:complexType>
> >         <xs:simpleType name="any-enumerated_set_of_class">
> >                 <xs:restriction base="idref_pattern"/>
> >         </xs:simpleType>
> >         <!--=====================-->
> >         <xs:complexType name="functional_mapping">
> >                 <xs:complexContent>
> >                         <xs:extension base="relationship">
> >                                 <xs:attribute name="input" 
> type="any-thing"
> > use="required"/>
> >                                 <xs:attribute name="result" 
> type="any-thing"
> > use="required"/>
> >                         </xs:extension>
> >                 </xs:complexContent>
> >         </xs:complexType>
> >         <!--=====================-->
> >         <xs:complexType name="difference_of_set_of_class">
> >                 <xs:complexContent>
> >                         <xs:restriction base="functional_mapping">
> >                                 <xs:attribute name="input"
> > type="any-enumerated_set_of_class"/> <!--problem spot-->
> >                                 <xs:attribute name="result" 
> type="any-class"/>
> >
> >                         </xs:restriction>
> >                 </xs:complexContent>
> >         </xs:complexType>
> >         <!--=====================-->
> >
> > I produced this code with an older version (4.4) of XML 
> Spy, and that seemed
> > to
> > be correct (perhaps at that time?).
> >
> > NOTE: From the rest of the schema one can derive that we 
> deal here with the
> > following path through the model hierarchy:
> > thing >> class >> class_of_class >> enumerated_set_of_class.
> >
> > You may wonder what I tried to achieve. That is a kind of 
> idref constraint,
> > where I cannot use idref, because:
> >
> >    * the referenced id's are not part of the XML document 
> (they are there,
> >      somewhere on the Internet)
> >    * the constraint shall be valid for all elements that 
> are typed with this
> >      complexType
> >    * the types like "any-enumerated_set_of_class" are in fact hidden
> > Processing
> >      Instructions, because the id referenced in the 
> attribute "input" shall
> > not
> >      only follow that pattern, but also belong to an 
> element (instance) that
> > is
> >      of the type "enumerated_set_of_class".
> >
> > Any suggestions how to solve this problem?
> >
> > Regards,
> > Hans
> >
> >
> 



From nobody@w... Wed Jan 05 01:48:34 2005
Received: from wiggum.w3.org ([128.30.52.23])
	by frink.w3.org with esmtp (Exim 4.34)
	id 1Cm0Hq-0003t4-Sh
	for xmlschema-dev@l...; Wed, 05 


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent