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


Help: OASIS Mailing Lists Help | MarkMail Help

docbook message

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

Subject: Re: DOCBOOK: Newbie - How to include entities?

Jim Ide <jide@lgb-inc.com> writes:

> [...]
> 1. The john, paul, george, and ringo entities are used throughout
> the chap1, chap2, and chap3 files.  I would like to keep the john,
> paul, george, and ringo entities (plus many others) in a separate
> file and include them.  Can I do this?  How?

If they're 'system wide' entities useful in other books, you might
declare them in the dbgenent.mod file (in same directory as the DTD).

Add entity declarations to that, and the entities will automatically
be available in all your DocBook documents. You won't need to set up
separate parameter entity references in your doc instances-- just the
same old DOCTYPE declaration pointing to your local DocBook DTD.

But if you don't have write permissions on dbgenent.mod, that setup
doesn't do you any good. And if these are 'local' entities you're
using only in one book, no point in putting them into dbgenent.mod at
all-- just use what Rune Enggaard suggested.

> 2. I am writing a users manual that will be showing error messages
> like "An error occurred in module ? - please contact the help desk."
> I currently do something like this:
> 	<!ENTITY part1	"An error occurred in module ">
> 	<!ENTITY part2	"please contact the help desk.">
> 	&part1; moduleX &part2;
> 	[...]
> Is it possible to create an entity or macro where I can substitute
> the % (or some other symbol) with a parameter? Maybe something like
> 	&errmsg(moduleX);
>       [...]
> to produce the same results?  Is it possible to pass multiple arguments?

As Rune Enggaard point outs, nothing like that available. But maybe a
better anyway to do it in the XSLT/DSSSL stage, using generated text.

You wouldn't have to put the "An error occurred in [module] - please
contact the help desk" anywhere in your doc instances. Instead use the
Role or maybe Condition attribute and do something like the following.
(Don't know your context, so this is just a contrived example).

  The following error message may appear:

  <errorname role="helpdesk">moduleX</errorname>

Then write a stylesheet customization layer with a template to catch
instances of <errorname role="helpdesk">, and wrap the generated text
around them. For help with that, send a note to the docbook-apps list.

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

Powered by eList eXpress LLC