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 type name
<http://www.w3.org/TR/xpath-datamodel/#dt-anonymous-type-name#dt-anonymous-t
ype-name>  that is distinct from the name of every named type and the name
of every other anonymous type. [dt_anonymous_type_nameDefinition: 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:16:51 UTC