tsd:which

Purpose

This element allows for different physical schema information, if a node can be referenced via multiple paths because of references to global elements or attributes. Physical schemas with the same absolute path expression can be grouped together. Therefore multiple tsd:which elements are allowed within a single tsd:physical element. If no tsd:which element is specified for a node, all paths have the same physical schema information.

The tsd:which element contains a string (of type xs:string) describing a path expression.

Parent element tsd:physical
Child elements None
Attributes None
Type xs:string
Restrictions

The following constraints exist on the XPath expression for tsd:which:

  • Only the absolute path expression / doctypeName / element /.../{ currentElementName | @ currentAttributeName } must exist in the current schema. All XPath expressions of all tsd:physical children of one element must be unique. This includes tsd:physical elements below tsd:elementInfo and tsd:attributeInfo elements below tsd:schemaInfo which are attached to the current element or attribute using the context attribute.

  • At most one tsd:physical without a tsd:which element is allowed within a single tsd:elementInfo or tsd:attributeInfo. The default for non-recursive elements covers all absolute paths to this element. If no tsd:which element is specified, the default applies: The default for non-recursive elements covers all absolute paths to this element. In case of possible recursions in the path to the current element or attribute only the first level of recursion is assumed.

Example

The following example contains two tsd:physical elements within a single tsd:elementInfo: the first one specifies physical schema information that only applies if the TITLELENGTH element occurs at one of the two paths specified by the tsd:which child elements. The second tsd:physical does not contain a tsd:which ("default which"), thus it applies to all instances of the TITLELENGTH element not occurring at one of the explicit paths specified by the tsd:which elements inside other tsd:physical element(s)."

<xs:element name = "TITLELENGTH">
  <xs:annotation>
    <xs:appinfo>
      <tsd:elementInfo>
        <tsd:physical>
          <!-- for /a/b/c/TITLELENGTH and /a/d/c/TITLELENGTH:
               SQL mapping and no (default) indexing -->
          <tsd:which> /a/b/c/TITLELENGTH </tsd:which>
          <tsd:which> /a/d/c/TITLELENGTH </tsd:which>
          <tsd:map>
            <tsd:nodeSQL Column="title"/>
          </tsd:map>
        </tsd:physical>
        <tsd:physical>
          <!-- default for all occurrences of TITLELENGTH:
               default native storage and standard index -->
          <tsd:native>
            <tsd:index>
              <tsd:standard/>
            </tsd:index>
          </tsd:native>
        </tsd:physical>
      </tsd:elementInfo>
    </xs:appinfo>
  </xs:annotation>
</xs:element>