Hi Bob,
I think the problem is in the targetdoc attributes in your olinkdb.xml
file. The targetdoc value in both a document's olink element and in the
database document element is just an identifier name, not a filename.
Those identifiers must match, and they will when you remove the ".xml"
from the targetdoc value in the database file.
There is a good reason why targetdoc is not a filename, and that is
because filenames can be changed without having to rewrite dozens of
olinks embedded in files.
Bob Stayton
Sagehill Enterprises
b...@sagehill.net
On 9/23/2016 11:36 AM, Bob McIlvride wrote:
Dear friends,
I am having problems getting olinks to correctly generate links between
books in a set in HTML output. I want to be able to output independent
books that contain references to content in other books, and when the
books are produced as part of a set, these references should become
links in HTML output.
I am using oXygen XML Editor 18.0 that uses Saxon to generate HTML
output. I've set up project files for two books (srr-book.xml and
dos-book.xml) and one set (test-set.xml) as a test. I have inserted one
olink in the srr-book that points to a section in the dos-book.
The test-set.xml document looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE set [
<!ENTITY % commonentities SYSTEM "../../Source/Common/commonentities.ent" >
%commonentities;
]>
<set xmlns="http://docbook.org/ns/docbook" version="5.0"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="test-set">
<info>
<title>Test Set</title>
</info>
<xi:include href="../SRRModule/srr-book.xml"/>
<xi:include href="../DHODBCScripting/dos-book.xml"/>
</set>
The olink markup in the srr-book.xml document looks like this:
<para>Not to be confused with <olink targetdoc="dos-book"
targetptr="dos-overview">Overview Link</olink>,which is something
altogether different.</para>
When the test-set.xml document is processed, oXygen gives this error
message:
[xslt] Error: unresolved olink: targetdoc/targetptr =
'dos-book/dos-overview'.
And the HTML output where the link should be looks like this:
<p>Not to be confused with <span class="olink">Overview Link</span>,
which is something altogether different.</p>
The olinkdb.xml files for the books and the set are as follows:
- srr-book.xml:
<?xml version="1.0" encoding="UTF-8"?>
<targetset>
<targetsetinfo> Description</targetsetinfo>
<document targetdoc="srr-book.xml">
<xi:include href="target.db"
xmlns:xi="http://www.w3.org/2001/XInclude"/>
</document>
</targetset>
- dos-book.xml:
<?xml version="1.0" encoding="UTF-8"?>
<targetset>
<targetsetinfo> Description</targetsetinfo>
<document targetdoc="dos-book.xml">
<xi:include href="target.db"
xmlns:xi="http://www.w3.org/2001/XInclude"/>
</document>
</targetset>
- test-set.xml:
<?xml version="1.0" encoding="UTF-8"?>
<targetset>
<targetsetinfo>A test of olink target sets.</targetsetinfo>
<document targetdoc="../SRRModule/srr-book.xml">
<xi:include href="../SRRModule/target.db"
xmlns:xi="http://www.w3.org/2001/XInclude"/>
</document>
<document targetdoc="../DHODBCScripting/dos-book.xml">
<xi:include href="../DHODBCScripting/target.db"
xmlns:xi="http://www.w3.org/2001/XInclude"/>
</document>
<document targetdoc="test-set.xml">
<xi:include href="target.db"
xmlns:xi="http://www.w3.org/2001/XInclude"/>
</document>
</targetset>
The target.db content that results from these olinkdb.xml files looks
correct. For example, here is the part that corresponds to the dos-book
that refers to the Overview section to which the olink points:
<div element="book" href="dos-book.html" number="" targetptr="dos-book">
<ttl>DataHub<sup
xmlns="http://www.w3.org/1999/xhtml">®</sup> ODBC Scripting</ttl>
<xreftext>DataHub<sup
xmlns="http://www.w3.org/1999/xhtml">®</sup> ODBC Scripting</xreftext>
<div element="chapter" href="dos-introduction.html"
number="1" targetptr="dos-introduction">
<ttl>Introduction</ttl>
<xreftext>Chapter 1, <em
xmlns="http://www.w3.org/1999/xhtml"
>Introduction</em></xreftext>
<div element="section"
href="dos-introduction.html#dos-overview" number="1.1"
targetptr="dos-overview">
<ttl>Overview</ttl>
<xreftext>Section 1.1, “Overview”</xreftext>
</div>
...
I think I am doing everything correctly and according to Bob Stayton's
clear and well-written documentation, but apparently I have missed
something. Can anyone see what I may be doing wrong?
Appreciatively yours,
Bob
COGENT <http://cogent.ca/>
*Bob McIlvride ** Communications Manager*
Cogent Real-Time Systems Inc., a Skkynet company
T 1 905 702 7851 ext 103
cogent.ca <http://cogent.ca/>
---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org