<?xml version="1.0"?>

<?xml-stylesheet href="skin/xlink.css" type="text/css"?>

<!DOCTYPE doc [
<!ENTITY lt "&#60;">
<!ENTITY gt "&#62;">
]>

<doc xmlns:xlink="http://www.w3.org/1999/xlink"
     xmlns:html="http://www.w3.org/TR/REC-html40">
  <table class="head">
    <tr>
      <td><html:img src="skin/dz.gif" width="70" height="26"></html:img></td>
      <td align="right">XLink Demo - Extended Links</td>
    </tr>
  </table>

<link xlink:type="extended">
  <a-loc xlink:type="locator" xlink:label="resolution-spec" xlink:href="specs.xml#resolution" />
  <a-loc xlink:type="locator" xlink:label="resolution" xlink:href="#resolution" /> 
  <an-arc xlink:type="arc" xlink:from="resolution" xlink:to="resolution-spec" xlink:title="What is resolution all about?"/>
</link>

<table>
  <tr>
    <td class="doc title">
      <h2>Camera ABC</h2>
      <html:img src="skin/camera.jpg" id="photo"></html:img>
      <text class="figure-text">Photo: Camera Model ABC</text></td>
      <td></td>
    <td class="xlink title">
      <h2>Example of extended XLinks</h2>
      <h4>The XLink code behind the links from the left side (colored in <fake-link2>blue</fake-link2>) is detailed in the right side.</h4>
      <h4>The root element must have declared the xlink namespace:</h4>
      <text class="feature-text">&lt;DOC xmlns:xlink="http://www.w3.org/1999/xlink"&gt;</text>
      <text class="feature-text">.....</text>
      <text class="feature-text">&lt;/DOC&gt;</text>
    </td>
  </tr>
  <tr class="odd">
    <td class="doc text">
      <text id="resolution" class="feature-title">Resolution</text>
      <text class="feature-text">2,240 x 1,680 pixels (interpolated)</text>
      <text class="feature-text">1,856 x 1,392 pixels</text>
      <text class="feature-text">1,856 x 1,232 pixels</text>
      <text class="feature-text">1,280 x 960 pixels</text>
      <text class="feature-text">640 x 480pixels</text>
    </td>
    <td></td>
    <td class="xlink code">
      <text class="code-info">Goes from one locator (point/element) to another. The starting point of the link will be #resolution. The extended link is declared somewhere in this document and looks like this:</text>
      <text class="xlink-code">
        <t>&lt;link xlink:type="extended"&gt;</t>
          <t2>&lt;a-loc xlink:type="locator" xlink:label="resolution-spec" xlink:href="specs.xml#resolution"/&gt;</t2>
          <t2>&lt;a-loc xlink:type="locator" xlink:label="resolution" xlink:href="#resolution"/&gt;</t2>
          <t2>&lt;an-arc xlink:type="arc" xlink:from="resolution" xlink:to="resolution-spec" xlink:title="What is resolution all about?"/&gt;</t2>
        <t>&lt;/link&gt;</t>
      </text>
      <text class="code-info">Now there is need only for an element to match the xlink:from locator. And we have here:</text>
      <text class="xlink-code">&lt;text id="resolution"&gt;<fake-link>Resolution</fake-link>&lt;/text&gt;</text>
    </td>
  </tr>
  <tr>
    <td class="doc text">
      <text class="feature-title">Standard connection</text>
      <text class="feature-text">Yes. See 
        <extlink xlink:type="extended">
          <res xlink:type="resource" xlink:label="point1">Other connectors</res> 
          <loc xlink:type="locator" xlink:label="point2" xlink:href="#other-connectors"/> 
          <arc xlink:type="arc" xlink:show="replace" xlink:from="point2" xlink:to="point1" xlink:title="Back to Standard connection"/>
          <arc xlink:type="arc" xlink:show="replace" xlink:from="point1" xlink:to="point2" xlink:title="Go to Other connections"/>
        </extlink>
      </text>
    </td>
    <td></td>
    <td class="xlink code">
      <text class="code-info">A link from one element(a resource) to another(a locator) and viceversa, declared with two arcs. The locator's target is an element with id="other-connectors" being at the end of this document.</text>
      <text class="xlink-code">
        <t>&lt;extlink xlink:type="extended"&gt;</t>
          <t2>&lt;res xlink:type="resource" xlink:label="point1"&gt;<fake-link>Other connectors</fake-link>&lt;/res&gt;</t2>
          <t2>&lt;loc xlink:type="locator" xlink:label="point2" xlink:href="#other-connectors"/&gt;</t2>
          <t2>&lt;arc xlink:type="arc" xlink:show="replace" xlink:from="point2" xlink:to="point1" xlink:title="Back to Standard connection"/&gt;</t2>
          <t2>&lt;arc xlink:type="arc" xlink:show="replace" xlink:from="point1" xlink:to="point2" xlink:title="Go to Other connections"/&gt;</t2>
        <t>&lt;/extlink&gt;</t>
      </text>
    </td>
  </tr>
  <tr class="odd">
    <td class="doc text">
      <text class="feature-title">
        <extlink xlink:type="extended">
          <loc xlink:type="locator" xlink:label="extern_start" xlink:href="deviceC.xml#xpointer(/1/2/3/1)"/>
          <loc xlink:type="resource" xlink:label="localresource">Image sensor</loc>
          <arc xlink:type="arc" xlink:from="extern_start" xlink:to="localresource" xlink:title="Go to Camera Image sensor specification"/>
        </extlink>
      </text>
      <text class="feature-text">1/1.8" CCD chip with 3,340,000 pixels</text>
      <text class="feature-text">See also <link xlink:type="simple" xlink:href="deviceC.xml" xlink:title="Device C">Device C</link> specification</text>
    </td>
    <td></td>
    <td class="xlink code">
      <text class="code-info">There can be created links in other docs then this one without touching them, because the links are declared here.
                              Now, in deviceC.xml there is a link to be found at this location -> deviceC.xml#xpointer(/1/2/3/1).
                              The target of this link is a local resource from here (extended.xml) pointing to "Image sensor" subtitle from the left.</text>
      <text class="xlink-code">
        <t>&lt;extlink xlink:type="extended"&gt;</t>
          <t2>&lt;loc xlink:type="locator" xlink:label="extern_start" xlink:href="deviceC.xml#xpointer(/1/2/3/1)"/&gt;</t2>
          <t2>&lt;loc xlink:type="resource" xlink:label="localresource"&gt;Image sensor&lt;/loc&gt;</t2>
          <t2>&lt;arc xlink:type="arc" xlink:from="extern_start" xlink:to="localresource" xlink:title="Go to Camera Image sensor specification"/&gt;</t2>
        <t>&lt;/extlink&gt;</t>
      </text>
    </td>
  </tr>
  <tr>
    <td class="doc text">
      <text class="feature-title">Image format</text>
      <text class="feature-text">JPEG (.jpg), TIFF (.tif) or MPEG <link xlink:type="simple" xlink:href="video.xml" xlink:title="All you need to know about video">video</link> (.mpg)</text>
    </td>
    <td></td>
    <td class="xlink code">
      <text class="code-info">The link from the left side opens the video.xml document which will popup a new window with a document containing the history of the video electronics.
                              This is similar to simple XLinks with actuate="onLoad" and show="new". The difference is that in video.xml we have an extended XLink.
                              The code in video.xml file looks like this:</text>
      <text class="xlink-code">
        <t>&lt;extlink xlink:type="extended"&gt;</t>
          <t2>&lt;loc xlink:type="locator" xlink:label="targetdocument" xlink:href="video-history.xml"/&gt;</t2>
          <t2>See also the new window just opened with &lt;res xlink:type="resource" xlink:label="locallink"&gt;the history of the video electronics&lt;/res&gt;.</t2>
          <t2>&lt;arc xlink:type="arc" xlink:from="locallink" xlink:to="targetdocument" xlink:actuate="onLoad" xlink:title="See also the history document"/&gt;</t2>
        <t>&lt;/extlink&gt;</t>
      </text>
    </td>
  </tr>
  <tr class="odd">
    <td class="doc text">
      <text class="feature-title">Internal <link xlink:type="simple" xlink:href="flashmem.xml" xlink:title="Flash memory documentation (flashmem.xml)">flash memory</link></text>
      <text class="feature-text">no</text>
    </td>
    <td></td>
    <td class="xlink code">
      <text class="code-info">We want to create 2 links when Flash Memory Documentation file is oppened. Both links will have 2 target choises.
                              For example, when clicked on "Compact Flash" type of memory from flashmem.xml file we want to have the option of choosing a camera, that uses that type of memory, to be redirected to.</text>
      <text class="code-info">The 2 multiple links will be created by this code being in flashmem.xml:</text>
      <text class="xlink-code">
        <t>&lt;ext xlink:type="extended"&gt;</t>
          <t2>&lt;loc xlink:type="locator" xlink:label="end" xlink:href="deviceA.xml" xlink:title="Device A"/&gt;</t2>
          <t2>&lt;loc xlink:type="locator" xlink:label="end" xlink:href="deviceB.xml" xlink:title="Device B"/&gt;</t2>
          <t2>&lt;loc xlink:type="locator" xlink:label="start" xlink:href="flashmem.xml#cf" xlink:title="Compact Flash Memory"/&gt;</t2>
          <t2>&lt;loc xlink:type="locator" xlink:label="start" xlink:href="resolution.xml#1mp" xlink:title="1 Megapixel Resolution"/&gt;</t2>
          <t2>&lt;arc xlink:type="arc" xlink:from="start" xlink:to="end" xlink:show="replace" xlink:actuate="onRequest" xlink:title="Choose from multiple camera specifications"/&gt;</t2>
        <t>&lt;/ext&gt;</t>
      </text>
    </td>
  </tr>
  <tr>
    <td class="doc text">
      <text class="feature-title">Removable memory</text>
      <text class="feature-text">
        <ext xlink:type="extended">
          <loc xlink:type="resource" xlink:label="here">Memory Stick</loc>
          <loc xlink:type="locator" xlink:label="memstick_doc" xlink:href="stickA.xml" xlink:title="Memory stick type A"/>
          <loc xlink:type="locator" xlink:label="memstick_doc" xlink:href="stickB.xml" xlink:title="Memory stick type B"/>
          <loc xlink:type="locator" xlink:label="memstick_doc" xlink:href="stickC.xml" xlink:title="Memory stick type C"/>
          <arc xlink:type="arc" xlink:from="here" xlink:to="memstick_doc" xlink:show="new" xlink:actuate="onRequest" xlink:title="Open all type of memory sticks"/>
        </ext>
      . 8 Mbyte removable memory media included. Inserted in the left side of the camera.</text>
    </td>
    <td></td>
    <td class="xlink code">
      <text class="code-info">The link from the left will popup 3 windows with types of memory sticks that wanted to be shown (recomended/in stock/available). The code behind:</text>
      <text class="xlink-code">
        &lt;ext xlink:type="extended"&gt;
          &lt;loc xlink:type="resource" xlink:label="here"&gt;<fake-link>Memory Stick</fake-link>&lt;/loc&gt;
          &lt;loc xlink:type="locator" xlink:label="memstick_doc" xlink:href="stickA.xml" xlink:title="Memory stick type A"/&gt;
          &lt;loc xlink:type="locator" xlink:label="memstick_doc" xlink:href="stickB.xml" xlink:title="Memory stick type B"/&gt;
          &lt;loc xlink:type="locator" xlink:label="memstick_doc" xlink:href="stickC.xml" xlink:title="Memory stick type C"/&gt;
          &lt;arc xlink:type="arc" xlink:from="here" xlink:to="memstick_doc" xlink:show="new" xlink:actuate="onRequest" xlink:title="Open all type of memory sticks"/&gt;
        &lt;/ext&gt;
      </text>
    </td>
  </tr>
  <tr class="odd">
    <td class="doc text">
      <text class="feature-title">Storage in <link xlink:type="simple" xlink:href="dcf.xml" xlink:actuate="onRequest" xlink:title="More details on DCF">DCF</link> standard</text>
      <text class="feature-text">yes</text>
    </td>
    <td></td>
    <td class="xlink code">
      <text class="code-info">This link opens the dcf.xml document which will popup a new window with a document representing a recomandation/solution for this specific problem. The owner of dcf.xml page wants that all its visitors to see this recomandation/solution in a new popup window.
                              The XLink code that popups the window is to be found in this document (extended.xml) and looks like this:</text>
      <text class="xlink-code">
        <t>&lt;extlink xlink:type="extended"&gt;</t>
          <t2>&lt;loc xlink:type="locator" xlink:label="trigger-doc" xlink:href="dcf.xml" xlink:title="DCF Documentation"/&gt;</t2>
          <t2>&lt;loc xlink:type="locator" xlink:label="popup-doc" xlink:href="dcf-solution.xml" xlink:title="DCF Recomandation/Solution"/&gt;</t2>
          <t2>&lt;arc xlink:type="arc" xlink:from="trigger-doc" xlink:to="popup-doc" xlink:show="new" xlink:actuate="onLoad" xlink:title="Open a solution"/&gt;</t2>
        <t>&lt;/extlink&gt;</t>
      </text>
      <extlink xlink:type="extended">
        <loc xlink:type="locator" xlink:label="trigger-doc" xlink:href="dcf.xml" xlink:title="DCF Documentation"/>
        <loc xlink:type="locator" xlink:label="popup-doc" xlink:href="dcf-solution.xml" xlink:title="DCF Recomandation/Solution"/>
        <arc xlink:type="arc" xlink:from="trigger-doc" xlink:to="popup-doc" xlink:show="new" xlink:actuate="onLoad" xlink:title="Open a solution"/>
      </extlink>
    </td>
  </tr>
  <tr>
    <td class="doc text">
      <text class="feature-title">Image deletion at the camera</text>
      <text class="feature-text">single pictures / all pictures. (Improved more on <link xlink:type="simple" xlink:href="deviceA.xml" xlink:title="Device A">Device A Camera</link>)</text>
    </td>
    <td></td>
    <td class="xlink code">
      <text class="code-info">Supposing one wants document redirections from Device A to Device B and then to Device C.
                              Clinking on the link on the left you will be redirected 3 times until deviceC.xml file reached.
                              Multiple redirections code looks like this:</text>
      <text class="xlink-code">
        &lt;ext-link xlink:type="extended"&gt;
          &lt;loc xlink:type="locator" xlink:label="file1" xlink:href="deviceA.xml" xlink:title="Filename is deviceA.xml"/&gt;
          &lt;loc xlink:type="locator" xlink:label="file2" xlink:href="deviceB.xml" xlink:title="Filename is deviceB.xml"/&gt;
          &lt;loc xlink:type="locator" xlink:label="file3" xlink:href="deviceC.xml" xlink:title="Filename is deviceC.xml"/&gt;
          &lt;arc xlink:type="arc" xlink:from="file1" xlink:to="file2" xlink:actuate="onLoad" xlink:title="Jump from Device A to Device B"/&gt;
          &lt;arc xlink:type="arc" xlink:from="file2" xlink:to="file3" xlink:actuate="onLoad" xlink:title="Jump from Device B to Device C"/&gt;
        &lt;/ext-link&gt;
      </text>
      <ext-link xlink:type="extended">
        <loc xlink:type="locator" xlink:label="file1" xlink:href="deviceA.xml" xlink:title="Filename is deviceA.xml"/>
        <loc xlink:type="locator" xlink:label="file2" xlink:href="deviceB.xml" xlink:title="Filename is deviceB.xml"/>
        <loc xlink:type="locator" xlink:label="file3" xlink:href="deviceC.xml" xlink:title="Filename is deviceC.xml"/>
        <arc xlink:type="arc" xlink:from="file1" xlink:to="file2" xlink:actuate="onLoad" xlink:title="Jump from Device A to Device B"/>
        <arc xlink:type="arc" xlink:from="file2" xlink:to="file3" xlink:actuate="onLoad" xlink:title="Jump from Device B to Device C"/>
      </ext-link>
    </td>
  </tr>
  <tr class="odd">
    <td class="doc text">
      <text id="other-connectors" class="feature-title">Other connectors</text>
      <text class="feature-text">AC adaptor input, PAL/NTSC video output (switchable), audio output. Different from <link xlink:type="simple" xlink:href="deviceD.xml" xlink:title:="Go to Device D Specification">Device D</link>.</text>
      <text class="feature-text">Click 
        <linkbaselink xlink:type="extended">
          <loc xlink:type="locator" xlink:label="linkbasedoc" xlink:href="linkbase.xml" xlink:title="A linkbase file containing extended XLinks"/>
          <res xlink:type="resource" xlink:label="locallink">here</res>
          <arc xlink:type="arc" xlink:from="locallink" xlink:to="linkbasedoc" xlink:actuate="onRequest" xlink:title="Loads linkbase links" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase"/>
        </linkbaselink> if you want to activate the links in linkbase.xml.
      </text>
    </td>
    <td></td>
    <td class="xlink code">
      <text class="code-info">XLink Linkbase. In linkbase files you can declare as many extended links as you want. 
                              Linkbase files are XML files separated from the browsed documents and containing only extended XLinks. 
                              The links declared in these files can be activated with a code like this:</text>
      <text class="xlink-code">
        <t>Click</t>
        <t>&lt;linkbaselink xlink:type="extended"&gt;</t>
          <t2>&lt;loc xlink:type="locator" xlink:label="linkbasedoc" xlink:href="linkbase.xml" xlink:title="A linkbase file containing extended XLinks"/&gt;</t2>
          <t2>&lt;res xlink:type="resource" xlink:label="locallink"&gt;<fake-link>here</fake-link>&lt;/res&gt;</t2>
          <t2>&lt;arc xlink:type="arc" xlink:from="locallink" xlink:to="linkbasedoc" xlink:actuate="onRequest" xlink:title="Loads linkbase links" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase"/&gt;</t2>
        <t>&lt;/linkbaselink&gt;</t>
        <t>if you want to activate the links in linkbase.xml.</t>
      </text>
      <text class="code-info">If you click on <fake-link>here</fake-link> link from the left the browser will load all the extended links from linkbase.xml file and activate them.
                              The -|| xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" ||- attribute makes the browser to treat this link like a special link, a link that loads a linkbase file.
                              Open Device D document first without clicking on <fake-link>here</fake-link> and you will see the difference after you click on it.</text>
      <text class="code-info">NB: The linkbase file can also be loaded automaticaly by an extended XLink with actuate="onLoad" placed in deviceD.xml.</text>
    </td>
  </tr>
</table>
</doc>
