This is the mail archive of the
docbook@lists.oasis-open.org
mailing list for the DocBook project.
Re: [docbook] repeating/re-occuring info
- From: martin dot gautier at myrnham dot co dot uk
- To: docbook at lists dot oasis-open dot org
- Date: Tue, 8 Jun 2004 00:26:27 +0100
- Subject: Re: [docbook] repeating/re-occuring info
René
>>I have a list in my docbook that I would like to re-occur in a few spots
in my document. I could do it by making that list an entity, but wouldn't
that screw up linking and cross-references to point to that list? Just
want to avoid copying/pasting.
You could use XInclude in the following fashion:
<book lang="en_GB">
<bookinfo>
<title>Book</title>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
href="legalnotice.subdoc.xml" />
</bookinfo>
...
</book>
where legalnotice.subdoc.xml looks like:
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"file:///c:/docbook/dtd/docbookx.dtd" []>
<legalnotice>
<title>Licensing Information</title>
<para>Copyright Notice</para>
...
</legalnotice>
In your case, the subdoc would encapsulate your list in some fashion.
Applying Stylesheets to get HTML or PDF (say) would be a 2 step process.
The first step being a call to xmlint.exe to "resolve" the docbook
document. ie. automatically resolve your xinclude references by inserting
the subdoc text into a new docbook document (which can then be converted
to HTML or PDF).
A extract from my batch file that does this looks like this:
echo Resolving XIncludes %1:
xmllint.exe -xinclude %1.xml > %1.resolved.xml
echo validating %1:
xmllint.exe -noout -valid -postvalid %1.resolved.xml
(where %1 is the name of my docbook document - without the extension).
Caveat: I understand that not all docbook elements can be used as the root
element in an xincluded subdoc. I can't remember why and I'm yet to
discover one that doesn't work (perhaps I've been lucky).
Mart
PS: If you do start using ede (see other posting), I can send you some
mods I made to the batch files to help me with this sort of issue.
To unsubscribe from this list, send a post to docbook-unsubscribe@lists.oasis-open.org, or visit http://www.oasis-open.org/mlmanage/.