This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
[docbook-apps] Code fragments, entities & Docbook
- From: Janeene Webb <webdesign at dawnmist dot net>
- To: docbook-apps at lists dot oasis-open dot org
- Date: Wed, 17 Dec 2003 14:52:18 +1100
- Subject: [docbook-apps] Code fragments, entities & Docbook
- Reply-to: webdesign at dawnmist dot net
Hi,
Am in the process of converting and updating an *old* manual into docbook
(partly because the old manual's files are no longer capable of being opened
due to old software not being supported, and they wanted to prevent this
happening again).
Have got a manual with 9 parts & a preface (containing more than 100 chapters
all told!), which has been broken down into separate files for each
part/preface. Within these, there are list of procedures, etc, that are
continually using the same image and caption (using mediaobject).
To prevent errors, and to make maintenance easier, it'd be nice to be able to
call the whole mediaobject fragment of code for that image as an entity, and
just declare it once.
The problem that I'm having is that if I call the entity through an xml
fragment, when I try and save the book the contents of the PART that the
entity first appears in gets pasted into the xml fragment, clobbering the
definition that was there in the first place, and *not* updating the actual
xml file for that part.
e.g. (A greatly simplified example)
Added to custom.dtd:
===================
<!-- load Common Images -->
<!ENTITY % commonimg SYSTEM "file://localhost/path/to/common_images.dtd">
%commonimg;
===================
common_images.dtd:
===================
<?xml version="1.0" encoding="UTF-8"?>
<!ENTITY key SYSTEM "./key.ent">
<!ENTITY procedure SYSTEM "./procedure.ent">
<!ENTITY target SYSTEM "./target.ent">
===================
key.ent:
===================
<mediaobject>
<imageobject>
<imagedata fileref="./key.gif" format="PNG"/>
</imageobject>
<textobject>
<phrase>Key Fields:</phrase>
</textobject>
</mediaobject>
===================
book.xml:
===================
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="file://localhost/path/to/editor.css" type="text/css"?>
<!DOCTYPE book SYSTEM "file://localhost/path/to/custom.dtd" [
<!ENTITY pt04 SYSTEM "./section04.xml">
<!ENTITY pt03 SYSTEM "./section03.xml">
<!ENTITY pt02 SYSTEM "./section02.xml">
<!ENTITY pt01 SYSTEM "./section01.xml">
<!ENTITY pref SYSTEM "./preface.xml">
]>
<book>
<title>Users Reference Guide</title>
&pref;
&pt01;
&pt02;
&pt03;
&pt04;
</book>
===================
preface.xml:
===================
<preface>
<title>Preface</title>
<para>Some stuff</para>
<para>&key; The key thing to remember.</para>
</preface>
===================
Now, with the above set of files (assuming of course that the parts are there
as well), when I hit the save button (using Morphon XML Editor 3.1.3) the
information for the _preface.xml_ file gets saved in the _key.ent_ file
instead, and the current contents of key.ent vanish. Any changes to the
preface also get "lost", since they go to the wrong file (although they are
recoverable as a result since I've learnt to look there!).
Is this a bug with the editor? Or is this just the wrong way to attempt to do
this? Is there another way that will include the full mediaobject definition
with the image & phrase definition within it?
Cheers,
Janeene Webb.
To unsubscribe from this list, send a post to docbook-apps-unsubscribe@lists.oasis-open.org, or visit http://www.oasis-open.org/mlmanage/.