OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] Olink: can't resolve xlink cross-refs.


Thanks Bob. I solved the problem, which I completely garbled in the
original post. I don't know why I brought up xlinks; I meant xincludes.
Many apologies.

Since my orginal question was such a waste of everyone's time, I may as
post the solution in case it helps someone. Here's the test of a simple
olink that I finally got to work.  Until I could figure this out, I
couldn't see how to avoid maintaining a separate database file for each
of many ref pages - rendering xincludes pretty useless for me. Here's the
essential code that seem to work:


#master document:
<book id="book">
   <title>Command Reference</title>
   <reference>
     <title>Commands</title>
     <xi:include href="command1.xml" />
     <xi:include href="command2.xml" />
   </reference>
</book>

#command1.xml:
<refentry id="cmd1">
   <refnamediv>
      <refname>cmd1</refname>
      <refpurpose>starts the client</refpurpose>
   </refnamediv>
   <refsection>
     <title>cmd2 ref section</title>
     <para>Test olink: refer to the <olink targetdoc="book"
     targetptr="synop"></olink> section of the command 2 page.</para>
   </refsection>
</refentry>

#command2.xml:
<refentry id="cmd2">
   <refnamediv>
     <refname>cmd2</refname>
     <refpurpose>determines compiler and linker flags</refpurpose>
   </refnamediv>
   <refsection id="synop">
     <title>SYNOPSIS</title>
     <cmdsynopsis>
       <command>sb-config</command>
       <arg rep="norepeat"><replaceable>option</replaceable></arg>
     </cmdsynopsis>
   </refsection>
</refentry>

#olinkdb.xml:
<?xml version="1.0" encoding="utf-8"?>
<targetset>
   <targetsetinfo>info </targetsetinfo>
   <sitemap>
     <dir name="../testolink">
       <document targetdoc="book">
         <xi:include href="target.db"
              xmlns:xi="http://www.w3.org/2003/XInclude"/>
       </document>
     </dir>
   </sitemap>
</targetset>

This version, using entities instead, also works:
#olinkdb.xml:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE targetset SYSTEM "targetdatabase.dtd" [
        <!ENTITY reftargets SYSTEM "target.db">
]>
<targetset>
   <targetsetinfo>info </targetsetinfo>
   <sitemap>
     <dir name="../testolink">
       <document targetdoc="book">
         &reftargets;
       </document>
     </dir>
   </sitemap>
</targetset>

Processing (using saxon 6.5.3)

#1. build olink database. If you don't use chunking, either specify the
     basuri in the database doc, or set the olink.base.uri parameter to
     the HTML filename.

java book.xml chunk.xsl collect.xref.targets="only" current.docid="book"

#2. Generate output using olink database.

java book.xml chunk.xsl target.database.document="olinkdb.xml"  \
current.docid="book"





[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]