Click here for ObjectSpace: Business- to- Business Integration Company
home account info subscribe login search My ITKnowledge FAQ/help site map contact us


 
Brief Full
 Advanced
      Search
 Search Tips
To access the contents, click the chapter and section titles.

Platinum Edition Using HTML 4, XML, and Java 1.2
(Publisher: Macmillan Computer Publishing)
Author(s): Eric Ladd
ISBN: 078971759x
Publication Date: 11/01/98

Bookmark It

Search this book:
 
Previous Table of Contents Next


Many of these attributes would strike even a veteran HTML author as strange; thus, a few additional words of explanation are probably in order. The ACTUATE attribute tells the processing application when the link should be traversed. If it is set to AUTO, the link is traversed when it is encountered. ACTUATE=”USER” means that the link should not be traversed until the user explicitly requests it. After the link traversal begins, the processing application can get more details about how to carry out the traversal from the BEHAVIOR attribute.

The SHOW attribute tells the processing application how to display the linked content with respect to the content it is currently displaying. Setting SHOW to REPLACE tells the application to overwrite the current content with the linked content. A SHOW value of EMBED means to embed the linked content inside the current content. Finally, setting SHOW to NEW directs the application to display the linked content in a new context that does not change the nature of the display of the current content (much like a Web browser launching a new instance to display a page instead of replacing the loaded page).

If a link is an inline link (as most simple links are), it is appropriate to use the CONTENT-ROLE and CONTENT-TITLE attributes to provide meaning and title information for the content. If the link is out-of-line, you can still specify CONTENT-ROLE and CONTENT-TITLE attributes, but they have no meaning in that context. Recall that out-of-line links are useful for creating multidirectional links, but they have meaning only in the context of a link group, which tells a processing application where to look for linking information.


NOTE:  Attribute names that start with XML are reserved for the further standardization of the linking specification. Therefore, you should not introduce an attribute name that starts with the string “XML” in any of your XML markup.

When setting up your link element, you can specify some default attribute values in your DTD that eliminate the need for a lot of extra typing. You know that <SIMPLINK> is intended to be a SIMPLE link, for example, and that it will most likely be inline, that users will probably want control over traversal of the link, and that the linked content should replace existing content. You can express all this in a DTD as follows:

<!ELEMENT simplink ANY>
<!ATTLIST simplink
     ACTUATE       (AUTO|USER)          “USER”
     BEHAVIOR       CDATA               #IMPLIED
     CONTENT-ROLE   CDATA               #IMPLIED
     CONTENT-TITLE  CDATA               #IMPLIED
     HREF           CDATA               #REQUIRED
     INLINE        (TRUE|FALSE)         “TRUE”
     ROLE           CDATA               #IMPLIED
     SHOW          (REPLACE|EMBED|NEW)  “REPLACE”
     TITLE          CDATA               #IMPLIED
     XML:LINK       CDATA               #FIXED “SIMPLE”
>

With this DTD, you could specify a link as simple as

<SIMPLINK HREF=”linked_doc.xml”>element_content</SIMPLINK>

Values of XML:LINK=”SIMPLE”, ACTUATE=”USER”, INLINE=”TRUE”, and SHOW=”REPLACE” are understood from the DTD.

Extended Links Extended links differ from simple links in that they can point to any number of resources that may or may not be co-located with the document in which the link is found. The result is a “multilinked” link that can take a user to one of many places.

Two types of elements are needed to specify an extended link. The first is one to contain link text for each individual linked resource, and the second is one to contain the elements that define the linked resources. As stated earlier, you can name XML elements in whatever way you choose. For this discussion, however, <EXTLINK> is the container element for the elements that specify individual resources, and <LOCATOR> is the element that contains link text for each resource. What that yields for a general extended link syntax is

<EXTLINK ...>
   <LOCATOR ...>Link text</LOCATOR>
   <LOCATOR ...>Link text</LOCATOR>
   ...
   <LOCATOR ...>Link text</LOCATOR>
</EXTLINK>

Each of these elements has a number of attributes, but they are the same as those used with the <SIMPLINK> element to define simple links. <EXTLINK> takes the following attributes:

  ACTUATE
  BEHAVIOR
  CONTENT-ROLE
  CONTENT-TITLE
  INLINE
  ROLE
  SHOW
  TITLE
  XML:LINK

For the <EXTLINK> element, you should set the XML:LINK attribute equal to EXTENDED or assign a default value of EXTENDED in the DTD. Otherwise, values and functions of the attributes are the same as specified in Table 11.1. Note that <EXTLINK> does not take the HREF attribute. This is because it contains the pointers to individual resources instead of pointing to something itself.

The <LOCATOR> element takes these attributes:

  ACTUATE
  BEHAVIOR
  HREF
  ROLE
  SHOW
  TITLE
  XML:LINK

<LOCATOR> elements do not point to linked resources. Because of this, the HREF attribute is necessary. You should set the XML:LINK attribute in a <LOCATOR> element to LOCATOR. Beyond that, the attributes are the same as in Table 11.1.

By putting it all together and including a DTD that specifies default attribute values, you might see a sample extended link that looks like this:

You can find a lot of good online references about
<EXTLINK>
<LOCATOR XML:LINK=”LOCATOR” HREF=”http://www.w3.org/XML/”>W3C XML Page</LOCATOR>
<LOCATOR XML:LINK=”LOCATOR” HREF=”http://www.ucc.ie/xml/”>XML FAQ</LOCATOR>
<LOCATOR XML:LINK=”LOCATOR” HREF=”http://developer.netscape.com/news/viewsource/
bray_xml.html”>Beyond HTML: XML and Automated Web Processing
by Tim Bray</LOCATOR>
XML
</EXTLINK>

In a browser, the text “XML” would be hyperlinked. However, when a user clicks the text, the browser needs to do something to present the multiple linking options. This might take the form of a pop-up menu that lists W3C XML Page, XML FAQ, and “Beyond HTML: XML and Automated Web Processing” by Tim Bray. Users could then choose from among these three options.


NOTE:  XLink does not say how an XML browser has to render an extended link. The method of rendering is up to whoever is programming the browser.


Previous Table of Contents Next


Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.