Simple links

This standard includes a similar feature to the primitive, one-directional linking scheme supplied by the XML standard, but makes it possible to traverse links between documents (as the HTML standard already permits). This is termed a simple link, and is identified using a simple-type element. As a simple link contains only one resource locator, this locator is stored in the linking element itself, using the Href attribute, as shown in previous examples:

<simpleLink ... xlink:href="locator">local resource
					name</simpleLink>

The content of the simple-type element would typically become 'active text' when the link is a hypertext link.

Internal links

The simplest form of link identifies an object in the same document. These 'semi-local' references must be preceded by a hash symbol, '#'. The target resource is identified as an element that contains an identical value (but without the hash symbol) in its Id attribute. A small part of the XPointer standard (see Chapter 28) is used here, and the example below is an abbreviation of the XPointer expression

'#xpointer(id("X123"))':



It is clear from the above description that this standard does not require the use of a DTD to identify attributes with values that can serve as unique target resource identifiers. However, such a DTD, with significant attributes assigned to the ID attribute type, could still be useful to ensure that target resources identified using attribute values do have unique identifiers.

External links

Using a URL, simple links can identify other documents on the local system:

<simpleLink xlink:href="file:///myDoc.xml">
  ...
</simpleLink>

The XML Base standard (see Chapter 11) is used to help resolve relative URLs.

Documents can also be accessed over the Web, using the HTTP protocol:

<simpleLink xlink:href="http://myHost.com/myDoc.xml">
...
</simpleLink>

Finally, an XPointer can be added to a URL to identify a sub-resource in another document.

<simpleLink xlink:href="file:///myDoc.xml#X123">
  ...
</simpleLink>

HTML emulation

The simple link feature is identical in nature to the use of the Anchor element in HTML, and it is also not a coincidence that the locator attribute name is 'Href'. In fact, it is possible to emulate HTML almost completely by naming the linking element 'A' (anchor), although a prefix is still needed on the Href attribute:

<!ELEMENT a     (#PCDATA)>
<!ATTLIST a     xlink:type     CDATA  #FIXED "simple"
                xlink:href     CDATA  #REQUIRED >

   See <a xlink:href="book9.xml">book 9</a> for details.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.83.185