Often, the scope of a cross reference will be adequately defined by the from attribute. For some documents, however, it may be necessary to define both a starting and an ending location: if for example the target crosses SGML element boundaries, or involves several elements. As noted above, the to attribute is provided for this purpose. For example,
<xptr doc=P1 from='id(xyz)' to='id(abc)'>is an extended pointer whose target is the part of the document P1 starting at the beginning of whatever element has identifier XYZ and ending at the end of whatever element in the same document has identifier ABC. Any elements in between are also included, irrespective of structure; the pointer is erroneous if the end of ABC precedes the start of XYZ.
The keyword DITTOkeyword can be used to simplify the specification of a location ladder for a to attribute which differs only slightly from that already supplied in the from attribute. For example:
<xptr from='id(xyz) ancestor(1 div) pattern(Hegel)' to='ditto pattern(Marx)'>will find the sequence starting with the first occurrence of the string `Hegel ' in the <div> element which is the immediate parent of an element with the identifier xyz and ending with the first occurrence of the string `Marx' that follows it within the same element.