Re: What would be the consequence of prohibiting local element and attribute declarations?

Original Message From: "Costello, Roger L."

Hi Roger,

Taking the following as an example...

<xs:element name="MyElement">
    <xs:complexType>
        <xs:sequence>
            <xs:element name="Simple" type="xs:int"/>
            <xs:element name="ComplexType" type="MyComplexType"/>
            <xs:element ref="ComplexRef"/>
            <xs:element name="ComplexLocal">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="another" type="xs:int"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
</xs:element>

Are you saying what are the implications of only allowing definitions as for 
"ComplexRef"?

I would say the definitions of "Simple", "CompleType" and "ComplexRef" are 
all sensible ways to go.  "ComplexLocal" should be avoided.

Using definitions like "Simple" seems to be unavoidable.

In principle there's not much to choose between "CompleType" and 
"ComplexRef", so it's worth deciding which mechanism you're going to use and 
be consistent.

Some of the differences come into play when crossing XML namespace 
boundaries.  Using "CompleType" the parent would have a name in the 
'importing' namespace and the children would be in the 'imported' namespace, 
whereas with "ComplexRef" both parent and children would be in the 
'imported' namespace which seems more natural.

But using the "ComplexRef" form would mean that every element called "Name" 
would have to have the same definition irrespective of whether it was a 
person's name (which may have given and family name sub-components) or a 
building name etc.

So my suggestion is to use the "CompleType" form within a namespace, and the 
"ComplexRef" across namespace boundaries.

(Not quite the question you asked, but I hope you can pick something out of 
it!)

HTH,

Pete Cordell
Codalogic Ltd
Interface XML to C++ the easy way using XML C++
data binding to convert XSD schemas to C++ classes.
Visit http://codalogic.com/lmx/ or http://www.xml2cpp.com
for more info
=============================================

----- Original Message ----- 
From: "Costello, Roger L." <costello@mitre.org>
To: <xmlschema-dev@w3.org>
Sent: Saturday, October 16, 2010 1:03 PM
Subject: What would be the consequence of prohibiting local element and 
attribute declarations?



Hi Folks,

Suppose a team has this XML Schema design policy:

   No local element or attribute declarations
   are permitted. All elements and attributes
   must be globally declared.

This policy strips the XML Schema language of a significant functionality. 
What are the consequences? Specifically what things will not be expressible 
because of this policy? Would this policy result in the creation of XML 
Schemas that don't integrate with other XML technologies?

/Roger

Received on Saturday, 16 October 2010 15:38:40 UTC