Hello izyw,
Stuart’s suggestion is precisely what I would propose. As Stuart describes, you can load the schema definition into a DOM structure in memory (using either the TDOMObjectModel or the TJDOMObjectModel) and then add the appropriate elements to define indexes.
Here is a small example to show what needs to be done at the schema level.
If, for example, there is an attribute “a” in the schema to which a standard index should be added… The original definition of “a” might look something like this in the schema:
<xs:attribute name="a" type="xs:string"></xs:attribute></pre><BR>To define a standard index on this attribute, it is necessary to add some further elements:<BR><pre class="ip-ubbcode-code-pre"> <xs:attribute name="a" type="xs:string">
<xs:annotation>
<xs:appinfo>
<tsd:attributeInfo>
<tsd:physical>
<tsd:native>
<tsd:index>
<tsd:standard/>
</tsd:index>
</tsd:native>
</tsd:physical>
</tsd:attributeInfo>
</xs:appinfo>
</xs:annotation>
</xs:attribute>
Although this may look a little daunting, keep in mind that you do not need to add the start & end tags in the DOM, just add child elements to the correct elements… Although you could also do a String based approach to modifying the schema, where you just insert the boilerplate text between the xs:attribute tags.
In either case the code to add this information will be reusable, as the tags from xs:annotation down will be the same (they will just be children of different elements).
The definition of a text index only differs in that the tag will be “tsd:text” rather than “tsd:standard”.
I hope that helps,
Trevor.
#webMethods-Tamino-XML-Server-APIs#webMethods#API-Management