Next in thread → Next in month →

Re: [docbook-apps] Olinks to different formats within the same document

From
"Cob Rtayton"
Date
2007-10-10T19:39:59+00:00
ID
017101c80b75$366e5a20$6400a8c0@totoro
Thread
Re: [docbook-apps] Olinks to different formats within the same document
Hi,

Yes, it is possible to link to the PDF version of 
one document and the HTML version of a different document.  An example 
might make it more clear.  Let's say you have userguide, confignotes, and 
reference documents.

 

For each document, generate a targets file for each 
of these, in both output formats (although you may not need them 
all):

 

targets.userguide.html.db 

targets.userguide.pdf.db

targets.confignotes.html.db

targets.confignotes.pdf.db

targets.reference.html.db

targets.reference.pdf.db

 

This requires running the process to 
collect.xref.targets twice for each book, using the HTML stylesheet and the FO 
stylesheet for each.

 

Let's say you are producing the PDF version of the 
userguide, and you want to olink to the PDF version of confignotes and an online 
chunked HTML version of the reference.  The olink database document for 
processing this userguide (using the FO stylesheet) would look something like 
this:

 

<?xml version="1.0" 
encoding="utf-8"?>

<DOCTYPE targetset [

<!ENTITY config SYSTEM 
"targets.confignotes.pdf.db">

<!ENTITY ref SYSTEM 
"targets.reference.html.db">

]>

<targetset>

  <document 
targetdoc="confignotes"  baseuri="ConfigNotes.pdf">

    &config;

  </document>

  <document targetdoc="reference" 
baseuri="http://mysite.com/books/Reference">

    &ref;

  </document>

</targetset>

 

It uses the baseuri attribute to form the first 
part of each link.  When resolving an olink from the userguide to 
confignotes, it creates a link like "ConfigNotes.pdf#mytarget". When resolving 
an olink from the userguide to reference, it creates a link like "http://mysite.com/books/Reference/thispage.html#sectionid". 

 

Bob Stayton
Sagehill Enterprises
DocBook Consulting


 

 

  
----- Original Message ----- 

  
From: 
  Dishaa 

  
To:  
  

  
Sent: Wednesday, October 10, 2007 9:04 
  AM

  
Subject: [docbook-apps] Olinks to 
  different formats within the same document

  

Hello Users,

Is it possible to provide cross-references 
  to different formats in a single document? For example, can I have a PDF 
  document that contains olinks to both HTML and PDF documents?

  DocBook XSL: The Complete Guide mentions that "...you 
  cannot do both formats for one document in the same database because each 
  targetdoc attribute must be unique within each language. So when you set up 
  the olink database file, you have to decide if you are targeting the HTML or 
  PDF version of a given document."
I understand that there needs 
  to be a target.db file for each kind of format (thought not necessarily) and 
  necessarily two separate Master Olink db files, but the above was not clear. 
  

I am on a slightly unfamiliar terrain, and would like 
  some pointers.

Thanks,

~ Dishaa 
“Many men go fishing all of their lives without 
  knowing it is not fish they are after" - Henry David Thoreau

  

  
  Fussy? Opinionated? Impossible to please? Perfect. Join 
  Yahoo!'s user panel and lay it on us.
Next in thread → Next in month →