Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xml-dev] Re: HL7 use of xs:anyType extension

From: "Pete Cordell" <petexmldev@--------------.--->
To: <xml-dev@-----.---.--->,"Boris Kolpackov" <boris@-------------.--->
Date: 6/8/2006 9:08:00 AM
Hi Boris,

Thanks for the analysis.

Just to check my understanding of what you are saying...  You're saying that 
MFA.5.CONTENT could add attributes, but could NOT possibly add child 
elements because the base type would suck them all up.

So if we have the following...

 <xsd:complexType name="varies">
  <xsd:complexContent>
    <xsd:extension base="xsd:anyType"/>
   </xsd:complexContent>
  </xsd:complexType>

   <xsd:complexType name="myType">
    <xsd:complexContent>
       <xsd:extension base="varies">
         <xsd:attribute name="foo" type="xsd:int"/>
       </xsd:extension>
     </xsd:complexContent>
   </xsd:complexType>

  <xsd:element name="myElement" type="myType"/>

Then a valid instance would be:

<myElement anotherAttribute="x" foo="y">bar</myElement>

but anotherAttribute and bar would just be skipped over.

Does that seem right?

Pete.
---- Original Message ----- 
From: "Boris Kolpackov" <boris@c...>
To: <xml-dev@l...>
Sent: Thursday, June 08, 2006 8:10 AM
Subject: [xml-dev] Re: HL7 use of xs:anyType extension


> Hi Pete,
>
> "Pete Cordell" <petexmldev@t...> writes:
>
>>  <xsd:complexType name="varies">
>>   <xsd:complexContent>
>>    <xsd:extension base="xsd:anyType"/>
>>   </xsd:complexContent>
>>  </xsd:complexType>
>>
>> I've seen (incorrect) comments on the web that say this is an attempt to
>> define an empty element.  Is this HL7's intent?  Or is it just an attempt 
>> to
>> map the name 'varies' to xsd:anyType?
>
> I believe varies is just an alias for anyType.
>
>
>> The above type is then used in the following situation...
>>
>>   <xsd:complexType name="MFA.5.CONTENT">
>>     <xsd:complexContent>
>>       <xsd:extension base="varies">
>>         <xsd:attributeGroup ref="MFA.5.ATTRIBUTES"/>
>>       </xsd:extension>
>>     </xsd:complexContent>
>>   </xsd:complexType>
>>
>> What sorts of XML instances should this map to?  An empty element with
>> attributes as defined in the attributeGroup?  Or, any number of 
>> attributes
>> and element body content, that must also include the set of attributes
>> defined in the attributeGroup?  i.e. is this some way of defining an
>> extensible instance?
>
> I think this definition does not make any sense. anyType matches any
> content. If we agree that, in case of an extension, a base type is
> matched before derived (which appears to be the case from the spec)
> then base anyType will match everything and not leave anything to the
> extension.
>
> So I would say that if MFA.5.ATTRIBUTES defines any required attributes,
> then the set of valid contents for this type is empty. Otherwise any
> content matches with attributes from MFA.5.ATTRIBUTES never getting any
> value.
>
> hth,
> -boris
>
>
> -- 
> Boris Kolpackov
> Code Synthesis Tools CC
> http://www.codesynthesis.com
> Open-Source, Cross-Platform C++ XML Data Binding
>
>
> -----------------------------------------------------------------
> 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://www.oasis-open.org/mlmanage/index.php>
>
>


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