Michael B. wrote:
I'm having some difficulties with olink. I may be misunderstanding it, but the problem I'm trying to solve is that I have two book documents that share a common chapter (saved as a third doc). The modular chapter links to something in the first document. I have written a second document now and reused the chapter, however the link does not work, as the linkend is not in the second document.One solution would be to create a linkend in the second document to satisfy the validation, but this is not ideal as it semantically doesn't make sense in the second document. Then I saw olink and thought that it might solve my problem. I was hoping that there would be a link in the second document that would link to, or at least include text that said something like "see section 2 in FirstDoc" or similar. (The included text is the most important part for me as a link won't work in a printed PDF anyway.) I have been experimenting this morning but I simply cannot get it to work when output as PDF and wondered if I'm missing something or if it is broken. I have attached the three experimenting files and a screenshot of my olink setup.
[email protected] wrote:
Sorry but we do not provide support about DocBook. See http://www.xmlmind.com/xmleditor/support.html#xmleditor_support_policy. Please note that there is no known problem related to links in general and olinks in particular, either in XMLmind XML Editor or in the DocBook XSL stylesheets.
Michael B. wrote:
Okay I accept that. But my example shows that the link appears as I would expect in the XXE a when following tutorials. It even asks and opens the FirstDoc when I click 'select link target'. But when I produce the PDF output the link is missing. I also tried producing HTML to make sure it wasn't my choice of format. You say there are no 'known' problems, but how do you know for sure that I haven't just found a new problem if you refuse to check?
We are using our own product every day. All our documents are modular. Almost all our documents make use of olinks. Therefore, yes, we are sure there is no problem either with our product, or with the DocBook XSL stylesheets, related to links.
Very unhelpful answer.
What follows is an answer which is as detailed as it can be. Because of its complexity, I doubt that you'll find it helpful.
1) About <xref linkend="secForeignLinks"/> found in chapReused.xml: chapReused.xml is included in both FirstDoc-EN.xml and SecondDoc.xml.Therefore an element having secForeignLinks as its ID must be found in either chapReused.xml itself or in *both* FirstDoc-EN.xml and SecondDoc.xml. Otherwise your <xref> does not make sense and you should remove it.
2) It is fine to replace <xref linkend="secForeignLinks"/> by <olink targetdoc="FirstDoc" targetptr="secForeignLinks" /> in chapReused.xml In fact, this <olink> is almost certainly the solution to your problem.But... <olink> requires you to create a special ``database'' for the set of your documents. Without this ``database'', the conversion to PDF cannot generate proper links.
How to make olink work is described here: http://www.sagehill.net/docbookxsl/Olinking.htmlNote that XMLmind XML Editor just helps you *creating* olinks. It will not help you *at* *all* using them to generate PDF, HTML, etc. This would be far too complicated to implement.
3) Please remove:<olink targetdoc="FirstDoc" targetptr="secForeignLinks"><xref linkend="secForeignLinks"/></olink>
as this olink a) is hard to understand, b) is not the solution to your problem.
--> Please find attached to my email a working example based on the files you sent us.
The out/ folder contains 2 .pdf files where the links work as expected. Description of what I did:a) In chapReused.xml, I've just kept <olink targetdoc="FirstDoc" targetptr="secForeignLinks" />
b) I've created this sitemap file by hand.
---
<!DOCTYPE targetset [
<!ENTITY FirstDoc SYSTEM "FirstDoc_pdf.targets">
<!ENTITY SecondDoc SYSTEM "SecondDoc_pdf.targets">
]>
<targetset>
<sitemap>
<dir name="out">
<document targetdoc="FirstDoc" baseuri="FirstDoc-EN.pdf">
&FirstDoc;
</document>
</dir>
<dir name="out">
<document targetdoc="SecondDoc" baseuri="SecondDoc.pdf">
&SecondDoc;
</document>
</dir>
</sitemap>
</targetset>
---
c) FirstDoc_pdf.targets is generated as follows (excerpts from makefile):
---
convertdoc -p collect.xref.targets only \
db5.toPSFile FirstDoc-EN.xml \
-s pdf -s "|pdf" -u out/FirstDoc-EN.pdf
mv target.db FirstDoc_pdf.targets
---
d) SecondDoc_pdf.targets is generated as follows:
---
convertdoc -p collect.xref.targets only \
db5.toPSFile SecondDoc.xml \
-s pdf -s "|pdf" -u out/SecondDoc.pdf
mv target.db SecondDoc_pdf.targets
---
e) out/FirstDoc.pdf is generated as follows:
---
convertdoc -p insert.olink.pdf.frag 1 \
-p current.docid FirstDoc \
-pu target.database.document pdf.sitemap \
db5.toPSFile FirstDoc-EN.xml \
-s pdf -s "|pdf" -u out/FirstDoc-EN.pdf
---
f) out/SecondDoc.pdf is generated as follows:
---
convertdoc -p insert.olink.pdf.frag 1 \
-p current.docid SecondDoc \
-pu target.database.document pdf.sitemap \
db5.toPSFile SecondDoc.xml \
-s pdf -s "|pdf" -u out/SecondDoc.pdf
---
convertdoc, part of XMLmind XML Editor, is documented here:
http://www.xmlmind.com/xmleditor/_distrib/doc/commands/convertdoc.html
olink_sample.tar.gz
Description: GNU Zip compressed data
-- XMLmind XML Editor Support List [email protected] http://www.xmlmind.com/mailman/listinfo/xmleditor-support

