Untitled Document



 Introduction to XML
 Data Definition and Data  Modeling
 Namespaces and  Schemas
 Linking and Querying
 Hyperlinks and its need
 
   Hyperlinks
   Links
   Linking and Querying
   XML information set
   Link elements
   Locators
   Xlinks
   Simple Links
   Extended links
   Extended link groups
 Inline and out-of-line  links
   Inline extended link
 Inline and out-of-line  links
 Out-of-line extended  links - link databases
   Link databases
   Link behavior
   Link effects
 Problem with HTML  pointers
   Xpointers
   Xpointer specification
 Specifying Xpointers  in a URI
   Elements Structure
   Location terms
   Relative terms
 Selection
 Querying using query  language
 
 Querying using  Query language
 Querying XML using  XPath and XSLT
   XSL & XSLT
 Row-wise restriction  of returned  information
 Column-wise  restriction
 Sorting
 Ecommerce Application  using XML

Copyrights : Layout Galaxy All Rights Reserved
No part of this tutorial may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, electrostatic, magnetic tape, mechanical or otherwise, without prior permission in writing from Layout Galaxy.




 Linking and Querying > Hyperlinks and its need

  Simple Links

Simple links are similar to HTML links, which are formed using the element A in HTML.

Simple links are used to jump from one source document to specified destination either within the same document or another document. Simple links have only one locator and hence move in one direction from source to target location. A Simple link contains a piece of text that acts as a resource, one end of the link.

An example for giving a simple link in a XML document is given here.

<sample.link xlink:form="sample" href="http:// m.com/title.XML" >see also
<sample.link>

  Extended links

Extended links allow us to link together any number of resources resulting in multiple targets instead of a simple one-to-one links in HTML.

Extended links allow XML documents to link to and from resources that cannot contain the links themselves. This includes graphic files, sound files, read-only documents and so on, which does not allow us to modify the contents or embed links.

They enable manipulations like filtering, addition and modification of links. For instance, imagine that we are able to modify the links at a certain point, so experienced readers of a technical manual can traverse a different path from that of novice readers.

Extended links also enable application software to process the links in different ways depending upon the requirements. An extended link does not directly point to anything or link anything together.

An extended link element identifies itself through its xlink:form attribute value and contains a set of locator elements that together form the extended link as shown. Here the comment element declares itself to be an extended link and an opinion element declares itself to be a locator element.

<comment xlink:form="extended">
          <opinion xlink:form="locator" href="link1"/>
          <reference href="#division1"/>
          <reference href="http://one.com/ first.html ">
          <reference href="references.htm"/>
</comment>

  Extended link groups

Links can be located in external documents. This is accomplished through the use of extended link groups.Similar to that of an extended link, an extended link group does not point or link to anything. Instead it contains a set of document elements, in which each document contains the link resources as shown.

<xternal.refs >
<ref.doc href="http:// first.com/one.html"/>
<ref.doc href="list.htm"/>
</xternal.refs>

When using extended link groups, there is a possibility of link element pointing to extended link group. If extended link group points back to the original document, or to a document containing another extended link group, then it would lead to infinite loops and links. To prevent the infinite linking, we can declare a value for the steps attribute of the group element. This specifies the limit of the number of layers that can be nested.

  Inline and out-of-line links

Extended links may be Inline extended link or Out-of-line extended links. By default, all link elements are Inline extended links. Extended links may be embedded in one of the resources participating in an extended link.

An inline link is an internal link; that is completely within the current document.
An out-of-line link refers to an external file that contains the link and target resource information.

  Inline extended link

<para id="para4">This is an
              <xref.list> example of
                       <see.also href="health.xml"/>
                       <see.also href=http://www.lifeline.com/defs.htm"/>
                       <see.also href="sample"/>
                       <xref.list>
              <xref.list> presented by …
</para>

Here is an example of an inline extended link. Here the xref.list element contains character data that serves as part of the associative trail formed by the links. Therefore the link element framed in the official terms of the X-Link specification contains a local resource of the link.

  Inline and out-of-line links

<xref.list>
        <see.also href="sample"/>
        <see.also href=health.xml"/>
        <see.also href="http://www.lifeline.com/defs.htm"/>
        <see.also href="sample"/>
</xref.list>

</para id="sample">
presented by ….</para>

Here is an example of out-of-line extended links. When the extended link is out-of-line link, it is no longer located in the same place as the link resources. It contains a pointer to the local link resource rather than the local link resource itself.

The figure shown here depicts the Inline extended link.

The type of the link, inline or out-of-line, does not specify the details like whether the link is located within the document or not.

Out-of-line links are particularly useful for extended link groups, which are a particular type of extended link.

A special type of <xlink:extended > element is used to indicate to an X-Link aware processor that out-of-line link exists for a particular document. Their role attribute should be set to xlink:external-linkset. The locator sub-elements, define external XML documents that contains the link and target locations.

<xlink:extended
       xmnls:xlink = "http:// www.w3.org/1999/xlink/namespace/"
       role="xlink:external-linkset">
<xlink:locator
       href="http: // www.wrox.com/Catalog/linkdb.xml"
       role="linkdatabase"
       title="Out-of-line catalog links" />
<xlink:extended>

Here is an example for out-of-line extended link using link databases. When Xlink-aware processor encounters the role attribute set to xlink:external-linkset, it reads the documents indicated in the locator sub-elements of the extended link that reference the document being processed.

Back Next


Copyrights : Layout Galaxy All Rights Reserved
No part of this tutorial may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, electrostatic, magnetic tape, mechanical or otherwise, without prior permission in writing from Layout Galaxy.




17, Vadsarvala Nivas, 65-A, J. Nehru Road, Mulund (W), Mumbai - 400 080 INDIA
Tel : 91-22-25795588, 91-22-25780444 Fax : 91-22-25793397
Email : ionline@vsnl.com
© Image Online 2001-2003