| 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.
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.
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.
|
|
|