Newbie trying to set up a splitted document
Posted: Fri Sep 21, 2012 3:38 pm
Hi all,
First of all: I am a newbie to docbook and to oxygen so please be patient with me if I am asking stupid questions.
What I am trying to do:
I want to create a book-type document with docbook 5 and I want each chapter to be in a separate file.
I want to be able to use the Oxygen Author mode which means that each file must be "full featured" and not just an included fragment.
I need a set of variables (entities) which can be used and replaced in any of the files.
I must be able to create links between the chapter files
Output formats are PDF and Webhelp
I managed to split up the documents and to handle the variables but I can not figure out how to get the links working.
The following setup is working except for the links:
The variables file variables.ent:
The main document file:
The chapter file GettingStarted.xml:
The chapter file Installation.xml:
As I said everything is working fine except the olink thing in GettingStarted.xml. I have been searching the web and trying for hours but I just can not figure out how to get it working. The recommended way is to use a target database like the following:
Target DataBase olinkdb.xml with entities:
However this does not work as the linked document must not have a DOCTYPE in this case (but I need the DOCTYPE to enable my variables file).
So I tried to use XIncludes instead:
Target DataBase olinkdb.xml with XIncludes:
Then I get an error that xi:include must be declared.
If I try to declare it as follows:
Then I get an error that xmlns:xi must be declared.
Can anyone out there help me with this before I am going crazy?
First of all: I am a newbie to docbook and to oxygen so please be patient with me if I am asking stupid questions.
What I am trying to do:
I want to create a book-type document with docbook 5 and I want each chapter to be in a separate file.
I want to be able to use the Oxygen Author mode which means that each file must be "full featured" and not just an included fragment.
I need a set of variables (entities) which can be used and replaced in any of the files.
I must be able to create links between the chapter files
Output formats are PDF and Webhelp
I managed to split up the documents and to handle the variables but I can not figure out how to get the links working.
The following setup is working except for the links:
The variables file variables.ent:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!ENTITY programname "The program">
<!ENTITY programversion "4.1">
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter [
<!ENTITY % variables SYSTEM "variables.ent">
%variables;
]>
<?xml-model href="http://www.oasis-open.org/docbook/xml/5.0/rng/docbookxi.rng"
schematypens="http://relaxng.org/ns/structure/1.0"?>
<book xmlns="http://docbook.org/ns/docbook"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink"
version="5.0" xml:lang="en" >
<info>
<title>&programname; Manual</title>
</info>
<part>
<xi:include href="GettingStarted.xml"
xmlns:xi="http://www.w3.org/2001/XInclude"/>
</part>
</book>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter [
<!ENTITY % variables SYSTEM "variables.ent">
%variables;
]>
<chapter xmlns="http://docbook.org/ns/docbook"
version="5.0" xml:id="chapterGettingStarted">
<title>
Getting Started
</title>
<para>
&programname; must have been installed properly.
Please refer to
<olink targetdoc="Installation"
targetptr="installation">Installation</olink>
for more information on the installation procedure.
</para>
</chapter>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter [
<!ENTITY % variables SYSTEM "variables.ent">
%variables;
]>
<chapter xmlns="http://docbook.org/ns/docbook"
version="5.0" xml:id="installation">
<title>
Installation
</title>
<section>
<title>
Program Setup Procedure
</title>
<para>
&programname; comes with an installation program.
</para>
</section>
</chapter>
Target DataBase olinkdb.xml with entities:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE targetset SYSTEM
"file:frameworks/docbook/xsl/common/targetdatabase.dtd" [
<!ENTITY chapterInstallation SYSTEM "Installation.xml">
<!ENTITY chapterGettingStarted SYSTEM "GettingStarted.xml">
]>
<targetset>
<targetsetinfo>
Description of this target database document,
which is for the olinks.
</targetsetinfo>
<sitemap>
<dir name="manual">
<document targetdoc="GettingStarted">
&chapterGettingStarted;
</document>
<document targetdoc="Installation">
&chapterInstallation;
</document>
</dir>
</sitemap>
</targetset>
So I tried to use XIncludes instead:
Target DataBase olinkdb.xml with XIncludes:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE targetset SYSTEM
"file:frameworks/docbook/xsl/common/targetdatabase.dtd" [
<!ENTITY chapterInstallation SYSTEM "Installation.xml">
]>
<targetset>
<targetsetinfo>
Description of this target database document,
which is for the olinks.
</targetsetinfo>
<sitemap>
<dir name="manual">
<document targetdoc="GettingStarted">
<xi:include href="GettingStarted.xml"
xmlns:xi="http://www.w3.org/2001/XInclude"/>
</document>
<document targetdoc="Installation">
<xi:include href="Installation.xml"
xmlns:xi="http://www.w3.org/2001/XInclude"/>
</document>
</dir>
</sitemap>
</targetset>
If I try to declare it as follows:
Code: Select all
<targetset xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0"
xml:lang="en">
Can anyone out there help me with this before I am going crazy?