This is the mail archive of the docbook@lists.oasis-open.org mailing list for the DocBook project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ulink, olink...


ulink is for pointing to a URL. Since local files can
be referenced as a URL, then ulink can work for local
file references.  The processing expectation for
ulink in HTML output is to form a working <A HREF=...>.
Your example with an xml file in a ulink would not
work in most browsers as an HREF since most browsers cannot
render XML delivered to them.  Until they can, most .xml
references are being rendered on the server and delivered
as HTML to the browsers.

olink is for pointing to some element with an ID attribute
in another XML document.  As the Definitive Guide explains,
"OLink provides a mechanism for establishing links across
documents, where ID/IDREF linking is not possible and ULink
is inappropriate."  The resolution of olinks is application
specific, meaning your application has to figure out how
to resolve such links since there is no built-in mechanism
beyond ID/IDREFs.

For more info, see Norm's paper on olink at:
http://nwalsh.com/docbook/dsssl/olinksemantics.html

bobs
Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
The Santa Cruz Operation, Inc.              fax:   (831) 429-1887
                                            email: bobs@sco.com
 
> From: Denis BERGER <d.berger@cstb.fr>
> 
> Here are my questions :
> 
> - What are the real differences between an ulink tag and an olink tag ?
> In others word, in which case using ulink and olink ? Is ulink reserved =
> to define an URL or can we use it for local files ?
> - Please find below an exemple of link that I'd like to do :
> 
> This code is extracted from the file afm.xml and refer to the file =
> afp.xml :
> What is the best solution ?
> 
> Solution 1 : with ulink
> <ulink url=3D"afp.xml#cor2.1.1">Cahier des Charges</ulink>
> 
> Solution 2 : with olink
> <!DOCTYPE book SYSTEM "sdocbook.dtd" [
> <!ENTITY afp SYSTEM "afp.xml">
> ]>
> ...
> <olink targetdocent=3D"afp" localinfo=3D"cor2.1.1">Cahier des =
> Charges</olink>
> 
> - This template defined in file xsl/html/xref.xml, why are attributes =
> not processed (LinkMode, LocalInfo, TargetDocEnt, Type) ?
> <xsl:template match=3D"olink">
>   <xsl:if test=3D"@id">
>     <a name=3D"{@id}"/>
>   </xsl:if>
>   <xsl:apply-templates/>
> </xsl:template>
> 
> - Last question, just for the fun !
> What is the meaning of the letter "O" in olink ?
> 
> Thanks in advance for your help,
> and excuse me for my average English,
> Denis
> 
> --
> Denis BERGER
> Centre Scientifique et Technique du Batiment (CSTB)
> Sophia Antipolis - France
> 
> --Boundary_(ID_QYoYFCQPTb//l0YALqwxtA)
> Content-type: text/html;	charset="iso-8859-1"
> Content-transfer-encoding: quoted-printable
> 
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML><HEAD>
> <META http-equiv=3DContent-Type content=3D"text/html; =
> charset=3Diso-8859-1">
> <META content=3D"MSHTML 5.50.4134.600" name=3DGENERATOR>
> <STYLE></STYLE>
> </HEAD>
> <BODY bgColor=3D#ffffff>
> <DIV>Hello folks,</DIV>
> <DIV>I need to use links, and I wonder how to do it with DocBook.</DIV>
> <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
> <DIV><FONT face=3DArial size=3D2>Here are my questions :</FONT></DIV>
> <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
> <DIV><FONT face=3DArial size=3D2>- What are the real differences between =
> an ulink=20
> tag and an olink tag ?</FONT></DIV>
> <DIV><FONT face=3DArial size=3D2>In others word, in which case using =
> ulink and olink=20
> ? Is ulink reserved to define an URL or can we use it for local files=20
> ?</FONT></DIV>
> <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
> <DIV><FONT face=3DArial size=3D2>- Please find below an exemple of link =
> that I'd=20
> like to do :</FONT></DIV>
> <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
> <DIV><FONT face=3DArial size=3D2>This code is extracted from the file =
> afm.xml and=20
> refer to the file afp.xml :</FONT></DIV>
> <DIV><FONT face=3DArial size=3D2>What is the best solution =
> ?</FONT></DIV>
> <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
> <DIV><FONT face=3DArial size=3D2>Solution 1 : with ulink</FONT></DIV>
> <P>&lt;ulink url=3D"afp.xml#cor2.1.1"&gt;Cahier des =
> Charges&lt;/ulink&gt;</P>
> <DIV><FONT face=3DArial size=3D2>Solution 2 : with olink</FONT></DIV>
> <DIV>
> <P>&lt;!DOCTYPE book SYSTEM "sdocbook.dtd" [<BR>&lt;!ENTITY afp SYSTEM=20
> "afp.xml"&gt;<BR>]&gt;<BR>...<BR>&lt;olink targetdocent=3D"afp"=20
> localinfo=3D"cor2.1.1"&gt;Cahier des Charges&lt;/olink&gt;</P></DIV>
> <DIV><FONT face=3DArial size=3D2>- This template defined in file =
> xsl/html/xref.xml,=20
> why are attributes not processed (LinkMode, LocalInfo, TargetDocEnt, =
> Type)=20
> ?</FONT></DIV>
> <DIV>&lt;xsl:template match=3D"olink"&gt;<BR>&nbsp; &lt;xsl:if=20
> test=3D"@id"&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;a name=3D"<A=20
> href=3D'mailto:{@id}"/'>{@id}"/</A>&gt;<BR>&nbsp; =
> &lt;/xsl:if&gt;<BR>&nbsp;=20
> &lt;xsl:apply-templates/&gt;<BR>&lt;/xsl:template&gt;</DIV>
> <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
> <DIV><FONT face=3DArial size=3D2>- Last question, just for the fun =
> !</FONT></DIV>
> <DIV><FONT face=3DArial size=3D2>What is the meaning of the letter "O" =
> in olink=20
> ?</FONT></DIV>
> <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
> <DIV><FONT face=3DArial size=3D2>Thanks in advance for your =
> help,</FONT></DIV>
> <DIV><FONT face=3DArial size=3D2>and excuse me for my average =
> English,</FONT></DIV>
> <DIV><FONT face=3DArial size=3D2>Denis</FONT></DIV>
> <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
> <DIV><FONT face=3DArial size=3D2>--</FONT></DIV>
> <DIV>Denis BERGER<BR>Centre Scientifique et Technique du Batiment=20
> (CSTB)<BR>Sophia Antipolis - France</DIV></BODY></HTML>
> 
> --Boundary_(ID_QYoYFCQPTb//l0YALqwxtA)--

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]