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


We are using Tamino under XP.

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


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

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

A document looks like this:


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.

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

Hi Uli.

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

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

Best regards Christian