| |
|
When comparing XML to HTML, XML’s huge data-centric feature set makes it an attractive alternative to HTML, as a standard document format. However, even when pairing XML with XSL’s formatting functionality, a feature-by-feature comparison of XML+XSL versus HTML will point out one major omission from XML’s list: hyperlinking. With HTML documents, adding hyperlinks is as easy as surrounding a piece of text with anchor (<a>) tags, and adding the link destination as a URL to the tag’s hyperlink reference (href) attribute, as follows:
|
|
Click <a href=”www.xmltc.com”>here</a> now.
|
|
This HTML statement is rendered as below, once displayed by a browser:
|
|
Click here now.
|
|
The underlined part of the text represents a link to the SOA Systems’ Web site. This simple ability to provide hyperlinks within a Web page text is arguably the Internet’s most powerful feature, yet an XML document (even when linked to an XSL style sheet) cannot provide this functionality on its own. This is why XLink was developed. Not only does XLink supply the ability to create HTML hyperlinks, its specification is equipped with an elaborate language that addresses many shortcomings of the HTML anchor tag.
|
|
For instance, with XLink, a document’s hyperlinks can be isolated in a separate link document. This centralizes link information the same way XSL style sheets centralize formatting information, and the benefits are very similar. If the destination address of a hyperlink changes, it only needs to be updated in one location. Also, in an HTML authoring environment, a document editor would need to have write permissions in order to add hyperlinks to a previously authored HTML document. This is no longer necessary, as the editor can now generate the links independently.
|
|
Additionally, with XLink developers can now add meta information to hyperlinks, which can provide the user with comprehensive information about the destination resource of a hyperlink, without having to visit it.
|
|
Finally, through the creation of a complex linking structure, XLink can even create linking associations between more than two resources.
|
|
XLink structures (regardless of whether they are embedded in XML documents or exist externally), can represent either “simple” or “extended” links (which is defined through the XLink type attribute). A simple link structure provides basic information to associate the origin and destination resources, as follows (note that the numbers on the left are line numbers):
|
1. <sample:linkelement xmlns:sample="http://www.samplereports.com/"
2. xmlns:xlink="http://www.w3.org/1999/xlink"
3. xlink:type="simple"
4. xlink:href="http://www.soasystems.com"
5. xlink:title="Report on SOA Systems Inc."
6. xlink:show="new">
7. SOA Systems Inc.
8. </sample:linkelement>
|
|
This XLink structure is really just an XML element definition with a series of attribute/value pairs. This first line:
|
|
xmlns:sample="http://www.samplereports.com/"
|
|
…defines the namespace within which this link file is active.
|
|
The second line:
|
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
…specifies the XLink specification used by the processor.
|
|
On the third line:
|
|
xlink:type="simple"
|
|
…the type attribute defines this structure as being of type “simple.”
|
|
|
return to homepage
SOA: Principles of Service Design
by Thomas Erl

An in-depth guide dedicated to service engineering with a thorough exploration of the design principles that comprise the service-orientation design paradigm (including a comparison with object-orientation).
Service-Oriented Architecture:
Concepts, Technology, and Design
by Thomas Erl

The first "how-to" guide to building SOA, providing coverage of WS-* specifications, .NET and J2EE platforms, and step-by-step processes for service-oriented analysis and design.
Service-Oriented Architecture:
A Field Guide to Integrating XML and Web Services
by Thomas Erl

The best-selling guide to service-oriented integration, providing hundreds of integration strategies and over sixty best practices.

For more information about either book, visit: www.soabooks.com
|
About SOA Systems

SOA Systems Inc. provides strategic SOA consulting services and offers a comprehensive SOA training program.

For more information see:

• www.soasystems.com

• www.soatraining.com

|
| |
| |
|
The fourth line:
|
|
xlink:href="http://www.soasystems.com"
|
|
…contains the familiar href attribute, which provides the address of the destination resource.
|
|
The title attribute on the fifth line:
|
|
xlink:title="Report on SOA Systems Inc."
|
|
…assigns the link a text value independent from the displayed text representing the link (this is similar to the HTML alt attribute).
|
|
On the sixth line:
|
|
xlink:show="new"
|
|
…the show attribute is comparable to the HTML target attribute, in that it provides options for how the browser will behave when opening the destination resource.
|
|
Finally, the last line before the XLink end-tag:
|
|
SOA Systems Inc.
|
|
…simply contains the text that is displayed in the browser, to which the hyperlink information is assigned.
|
Extended links are beyond the scope of this paper, however it is sufficient to state that they introduce the ability to create complex link structures by providing the features to identify multiple link “participants” which can be associated in different ways. Additionally, the “link traversal” paths between participants can also be defined by extended link structures.
|
|
|