next up previous
Next: Referring to an Entire Document
Up: ESTABLISHING CROSS-REFERENCES
Previous: Exporting Cross-Reference Targets

  Referring to Cross-Reference Targets

To establish a cross-reference to another document you again use an HTML anchor, this time with the HREF parameter, in a form similar to the following:gif

<A HREF="/star/docs/sun188.htx/node33.html#xref_appendix">any text</A>

This is, of course, the standard HTML method of forming a hypertext link to another location identified by the Uniform Resource Locator (URL) given between double quotes. If this URL is correct (i.e. fully identifies the HTML file you want to reference), then this anchor will work as it stands, without any intervention from HTX.

What makes this link special to HTX is the particular form that the URL takes. Anchors containing such URLs are recognised by HTX and can then be repaired when the cross-reference target changes, by appropriately editing new values into the fields that are no longer valid. The key components of the URL that HTX recognises are:

/sun188.htx/

which identifies the name of the document being referenced (in this case "sun188", i.e. this document), and:

#xref_appendix

where "#xref_" is a flag that identifies this as an HTX cross-reference and "appendix" is the cross-reference label in the target document that identifies which part of that document is being referenced. Note that HTX will only allow you to refer to cross-reference labels that have been exported by the target document and will warn you if you use an invalid label.

Because HTX can repair URL fields that are wrong, it is quite acceptable to omit everything inessential and to strip the URL down to just:

<A HREF="/sun109.htx/#xref_conclusions">any text</A>

However, entering a full URL (or at least a guess at it) is often a good idea to start with, as it means the cross-reference may still work even if someone forgets to link your document.



next up previous
Next: Referring to an Entire Document
Up: ESTABLISHING CROSS-REFERENCES
Previous: Exporting Cross-Reference Targets



HTX Hypertext Cross-Reference Utilities
Starlink User Note 188
R.F. Warren-Smith
6th January 1998
E-mail:rfws@star.rl.ac.uk