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

  Out-of-line extended links - link databases

The figure shown here depicts the out-of-line extended link.

If we then add xlink:external-linkset extended links to the four linked documents, information for the external link will be available when any of the documents is the current document.


  Link databases

We can maintain a list of links between documents using extended link groups. We shall now see how to create a list of menu items using extended link groups and how to link the documents. To do this, we first create an XML document menulink.xml as shown for displaying the main menu. This document has links to first.XML, second.XML, third.XML, four.XML and five.XML.

<xlink:extended xmnls:xlink="http:// www.w3.org/1999/xlink/namespace/"
                                role="menu links"
                                title="refer to other parts of menu also"
    <xlink:locator href="first.xml"
                                role="page 1"
                                title="Fruits"/>
    <xlink:locator href="second.xml"
                                role=" page 2"
                                title="Ice creams"/>
    <xlink:locator href="third.xml"
                                role=" page 3"
                                title="Drinks"/>
    <xlink:locator href="four.xml"
                                role=" page 4"
                                title="Desserts "/>
    <xlink:arc from=" page 2"
                                to=" page 3"
                                show="replace "
                                actuate= "onRequest"/>
    <xlink:arc from=" page 3"
                                to=" page 4"
                                show="replace "
                                actuate= "onRequest"/>
</xlink:extended>

Create a new XML document as shown and name it as first.xml.

<menupage xmnls:xlink="http: // www.w3.org/1999/xlink/namespace/">
     <xlink:extended role="xlink:external-linkset">
          <xlink:locator href="menu.xml"/>
     </xlink:extended>
     <menuitem>
               <name>Apple</name>
               <price> $0.99</price>
     </menuitem>
               <name>Orange</name>
               <price> $1.09</price>
     </menuitem>
<menuitem>
               <name>Cherry</name>
               <price> $1.25</price>
</menuitem>

On opening the link file first.xml, an Xlink aware processor will read the extended link information from the menulink.xml document and render the document in a way that will make it clear that this document links to second.xml. A browser might choose to render the information this way. Similar to that of first.XML, the other link documents can be created.

To add the item pasta to the menu, modify the link database document, then create the five.xml document for the pasta items.

<xlink:extended xmnls:xlink=http://www.w3.org/1999/xlink/namespace/
                                role="menu links"
                                title="see other parts of menu"
          <xlink:locator href="first.xml"
                                role=page 1"
                                title="Fruits"/>
          <xlink:locator href="second.xml"
                                role= page 2"
                                title="Icecream"/>
          <xlink:locator href="third.xml"
                                role= page 3"
                                title="Drinks"/>
          <xlink:locator href="four.xml"
                                role=menu page 4"
                                title="Desserts"/>
          <xlink:locator href="five.xml"
                                role=page 5"
                                title="Pasta"/>
          <xlink:arc from =" page 1 "
                                to=" page 2"
                                show="replace">
                                actuate="onRequest"/>
          <xlink:arc from=" page 2"
                                to= page 3"
                                show="replace">
                                actuate="onRequest"/>
          <xlink:arc from=" page 3"
                                to= page 4"
                                show="replace">
                                actuate="onRequest"/>
          <xlink:arc from=" page 3"
                                to= page 5"
                                show="replace">
                                actuate="onRequest"/>
          <xlink:arc from=" page 5"
                                to= page 4"
                                show="replace">
                                actuate="onRequest"/>
</xlink:extended>

Our browser would reflect the changes automatically. If we wanted to change the order the menu pages were traversed, we could do so by modifying the link database document.

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-21645588, 91-22-21640585 Fax : 91-22-21641545
Email : ionline@vsnl.com
© Image Online 2001-2003