Where to place tsd:index on an attribute of a ref-element?

Hello!

We are using Tamino 4.4.1.1 under XP.

We made up a doctpye-schema which references other doctypes:

<schema…>

<xs:include schemaLocation = “methodHeaderSchema”></xs:include>
<xs:include schemaLocation = “reportedPersonSchema”></xs:include>

<xs:element name = “stateMachine”>
xs:complexType
xs:sequence
<xs:element ref = “methodHeader” ></xs:element>
<xs:element ref = “reportedPerson” ></xs:element>
</xs:sequence>
<xs:attribute name = “dateOfDeath” use = “required”>

A document looks like this:
xql:result




</xql:result>

For the attribute “sessionID” of the referenced “methodHeader” I want to define an Index using tsd:index.

My simple question is: where to place it?

Any hint it welcomed.
Christian

Hi Christian

there are two ways - in both cases you need a
tsd:attributeInfotsd:physicaltsd:nativetsd:indextsd:standard</… >…</tsd:attributeInfo>, but the way how this is associated with the attribute declaration differs:

(1) place the tsd:attributeInfo inside xs:annotationxs:appinfo inside the attribute declaration (i.e. if there is an <xs:attribute ref=…/>, then at the referenced global attribute declaration)

(2) put the tsd:attributeInfo with an additional attribute context=“stateMachine/methodHeader/@sessionID” below tsd:schemaInfo having the <tsd:doctype name=“stateMachine”> child

Approach (1) will be rejected if the attribute is declared in an included schema which is defined in another collection, (2) does not have this restriction.

Best regards
Uli

Hi Uli.

Thanks for your help.
Finally we decided to use tsd:unique, because this more suitable:

<tsd:doctype name = “stateMachine”>
tsd:logical
tsd:contentclosed</tsd:content>
<tsd:unique name = “D-sessionID”>
<tsd:field xpath = “methodHeader/@sessionID”></tsd:field>
</tsd:unique>
</tsd:logical>
</tsd:doctype>

Best regards Christian