RE: element with anonymous type in a group

It's useful to start with the Note in section 3.4.6:
 
<quote>
Note:

The wording of clause 2.1 <http://www.w3.org/TR/xmlschema-1/#c-tid>  above
appeals to a notion of component identity which is only incompletely defined
by this version of this specification. In some cases, the wording of this
specification does make clear the rules for component identity. These cases
include: 

*	When they are both top-level components with the same component
type, namespace name, and local name;
*	When they are necessarily the same type definition (for example,
when the two types definitions in question are the type definitions
associated with two attribute or element declarations, which are discovered
to be the same declaration);
*	When they are the same by construction (for example, when an
element's type definition defaults to being the same type definition as that
of its substitution-group head or when a complex type definition inherits an
attribute declaration from its base type definition).

In other cases two conforming implementations may disagree as to whether
components are identical.

</quote>

I'm not sure that your example is covered by any of these cases, so one
might conclude that the question of identity is unclear in this case.

Michael Kayhttp://www.saxonica.com


  _____  

From: xmlschema-dev-request@w3.org [mailto:xmlschema-dev-request@w3.org] On
Behalf Of Antoli, Leo
Sent: 25 January 2007 12:15
To: xmlschema-dev@w3.org; xml-dev@lists.xml.org
Subject: element with anonymous type in a group



Hi all,

 

My question is about what happens when an element with an anonymous type is
defined in a group. Then when the group is referenced in several locations,
is it the same anonymous type or they're actually different types (of course
with the same definition)?

 

When an anonymous type is used (e.g. in a XSLT or XQuery)  XDM (XQuery 1.0
and XPath 2.0 Data Model) says that anonymous types must be given a unique
name:

For anonymous types, the processor must construct an anonymous
<http://www.w3.org/TR/xpath-datamodel/#dt-anonymous-type-name#dt-anonymous-t
ype-name> type name that is distinct from the name of every named type and
the name of every other anonymous type. [Definition: An anonymous type name
is an implementation dependent, unique type name provided by the processor
for every anonymous type declared in the schemas available.] Anonymous type
names must be globally unique across all anonymous types that are accessible
to the processor. In the formalism of this specification, the anonymous type
names are assumed to be xs:QNames, but in practice implementations are not
required to use xs:QNames to represent the implementation-dependent names of
anonymous types.

Imagine we have this schema:

 

<xsd:group name="myGroup">

       <xsd:sequence>

              <xsd:element name="myElement">

                     <xsd:complexType>

                           <xsd:sequence>

                           .............................................

                           </xsd:sequence>

                     </xsd:complexType>

              </xsd:element>

       </xsd:sequence>

</xsd:group>

<xsd:element name="parent1">

       <xsd:complexType>

              <xsd:group ref="myGroup"/>

       </xsd:complexType>

</xsd:element>

<xsd:element name="parent2">

       <xsd:complexType>

              <xsd:group ref="myGroup"/>

       </xsd:complexType>

</xsd:element>

 

 

The question is:

 

Do myElement local element in parent1 and parent2 have the same type? Or are
they different as they're local elements with anonymous types?

 

So should myElement type in parent1 have a different unique-name to
myElement type in parent2? Or should they have the same unique name?

 

I mean, is a group like a "copy/paste" so when a reference is done to a
group is just like putting the group content there (so it would be like
declaring a anonymous type twice)? Or implementation can be a bit "clever"
and realise that they're really the same type even if it's anonymous and
assign the same unique name to myElement type in both parent1 and parent2.

 

 

Thanks a lot.

 

Regards,

Leo Antoli

 



This email message is intended for the named recipient only. It may be
privileged and/or confidential. If you are not the named recipient of this
email please notify us immediately and do not copy it or use it for any
purpose, nor disclose its contents to any other person.    

 

Misys Banking Systems is a trading name of Misys International Banking
Systems Limited which is registered in England and Wales under company
registration number 00971479 and with its registered office address at
Burleigh House, Chapel Oak, Salford Priors, Evesham WR11 8SP. 

 

THIS E-MAIL DOES NOT CONSTITUTE THE COMMENCEMENT OF LEGAL RELATIONS BETWEEN
YOU AND MISYS INTERNATIONAL BANKING SYSTEMS LIMITED. PLEASE REFER TO THE
EXECUTED CONTRACT BETWEEN YOU AND THE RELEVANT MEMBER OF THE MISYS GROUP FOR
THE IDENTITY OF THE CONTRACTING PARTY WITH WHICH YOU ARE DEALING. 

Received on Thursday, 25 January 2007 12:39:46 UTC