docbook-apps

  • 1.  olink basics

    Posted 07-05-2010 18:59
    Currently we are not "chunking" documentation but at some point I would
    like to be able to do that. To that end, because currently there are no
    cross-references at all, I want to implement cross-references so they
    will work whether or not the documents are "chunked" at transformation.

    I had no luck with <olink> because when I did the transform I always got
    a failure to resolve the olinks.

    To start with I wanted to olink between two chapters in a book. I added
    an xml:id to each <chapter> tag and, because all chapter files are in
    the same directory, used the following as the olink.db:


    SYSTEM "targetdatabase.dtd" [

    ]>
    <targetset>

    <document targetdoc="SDKIntroduction"
    baseuri="CAStorSDKOverview.html">
    </document>


    <document targetdoc="SDKEnumeration">
    </document>



    </targetset>

    Question: Does the name of "baseuri" have to correspond to anything?
    Should it correspond to the name of the chapter (SDKIntroduction) or to
    the book (CAStorSDKOverview)?

    Link: <olink targetdoc="SDKEnumeration" targetptr="StartMethod"/>

    Transform command line:

    xsltproc --output c:\<filename> /
    --stringparam collect.xref.targets "yes" /
    --stringparam target.database.document "olinkdb.xml" /
    --stringparam current.docid "CAStorSDKOverview" /
    --xinclude C:\<our-custom-xsl> C:\<book-file>

    Result:


    Writing target.db for book(CAStorSDKOverview)
    Error: unresolved olink: targetdoc/targetptr = 'SDKEnumeration/StartMethod'.

    --

    ------------

    Steve Johnson, Senior Content Developer
    Caringo
    stevej@caringo.com



  • 2.  UPDATE: olink basics

    Posted 07-06-2010 17:14
    The more basic question is, should <olink> be used in this case at all?

    The description of olink is: "The olink element is the equivalent for
    linking outside the current document." (from Bob Stayton's book)

    I think this is an extremely vague way to describe it because "document"
    is ambiguous and the author uses that term consistently throughout his
    book. To me, an XML file is a *document* but apparently what the author
    intends to say is "book" or, more verbosely, "...outside the document
    after it has been transformed."

    How about if the same book is chunked? Will I then have to replace my
    <xref>s with <olink>s?

    On 7/5/2010 1:59 PM, Steve Johnson wrote:
    > Currently we are not "chunking" documentation but at some point I would
    > like to be able to do that. To that end, because currently there are no
    > cross-references at all, I want to implement cross-references so they
    > will work whether or not the documents are "chunked" at transformation.
    >
    > I had no luck with <olink> because when I did the transform I always got
    > a failure to resolve the olinks.
    >
    > To start with I wanted to olink between two chapters in a book. I added
    > an xml:id to each <chapter> tag and, because all chapter files are in
    > the same directory, used the following as the olink.db:
    >
    >
    > > SYSTEM "targetdatabase.dtd" [
    >
    > ]>
    > <targetset>
    >
    > <document targetdoc="SDKIntroduction"
    > baseuri="CAStorSDKOverview.html">
    > </document>
    >
    >
    > <document targetdoc="SDKEnumeration">
    > </document>
    >
    >
    >
    > </targetset>
    >
    > Question: Does the name of "baseuri" have to correspond to anything?
    > Should it correspond to the name of the chapter (SDKIntroduction) or to
    > the book (CAStorSDKOverview)?
    >
    > Link: <olink targetdoc="SDKEnumeration" targetptr="StartMethod"/>
    >
    > Transform command line:
    >
    > xsltproc --output c:\<filename> /
    > --stringparam collect.xref.targets "yes" /
    > --stringparam target.database.document "olinkdb.xml" /
    > --stringparam current.docid "CAStorSDKOverview" /
    > --xinclude C:\<our-custom-xsl> C:\<book-file>
    >
    > Result:
    >
    >
    > Writing target.db for book(CAStorSDKOverview)
    > Error: unresolved olink: targetdoc/targetptr =
    > 'SDKEnumeration/StartMethod'.
    >

    --

    ------------

    Steve Johnson, Senior Content Developer
    Caringo
    stevej@caringo.com



  • 3.  RE: [docbook-apps] UPDATE: olink basics

    Posted 07-06-2010 18:55
    Hi Steve,
    olink is exactly what I use for the same reasons you bring up. I generate DocBook chapters and every link is an olink.

    That works for the individual chapter for its own internal links and links to other external chapters. And it works when all the chapters are xincluded into one book.

    I'm using this in my configuration:
    <xsl:param name="prefer.internal.olink" select="1"></xsl:param>

    --Tim Arnold


    >