This is the mail archive of the
docbook@lists.oasis-open.org
mailing list for the DocBook project.
Re: entity reference into entity definition
- To: docbook at lists dot oasis-open dot org
- Subject: Re: DOCBOOK: entity reference into entity definition
- From: Jorge Godoy <godoy at conectiva dot com dot br>
- Date: Tue, 15 Feb 2000 21:39:21 -0200
- References: <38A9A095.176A3243@mandrakesoft.com>
- Reply-To: docbook at lists dot oasis-open dot org
On Tue, Feb 15, 2000 at 02:53:09PM -0400, Camille Begnis wrote:
> Hello,
>
> I'm working on a document translated to many languages. While the
> structure of the document is the same for each language, I would like to
> have a unique "top" sgml document referencing the chapters of a single
> language.
>
> My question is How do I parametrize the call to different languages?
>
> I tried something like that, but it doesn't work:
>
> <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [
> <!ENTITY Lang "en" >
> <!ENTITY ch-a SYSTEM "⟪/legal_notice_chapter.sgml">
> ...
>
> the different chapters being stored in en/ fr/ es/ ... directories
> depending on the language.
>
> I want to be able to change one single entity (Lang) in order to have
> my target doc in french (for ex.)
How about using a parameter entities? You would have this main file with
"sections" selected accordingly to these entities values.
E.g.:
<!doctype book PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [
<!-- Define the desired output language -->
<!entity % en "INCLUDE">
<!entity % fr "IGNORE">
<!entity % es "IGNORE">
...
<!-- Define the external entities containing the document text -->
<!-- English -->
<!entity chap1-en SYSTEM "en/chap1.sgml">
<!entity chap2-en SYSTEM "en/chap2.sgml">
...
<!-- French -->
<!entity chap1-fr SYSTEM "fr/chap1.sgml">
<!entity chap1-fr SYSTEM "fr/chap2.sgml">
...
<!-- Spanish -->
<!entity chap1-es SYSTEM "es/chap1.sgml">
<!entity chap1-es SYSTEM "es/chap1.sgml">
...
]>
<book>
<bookinfo>
...
</bookinfo>
<![%en;[
&chap1-en;
&chap2-en;
...
]]>
<![%fr;[
&chap1-en;
&chap2-en;
...
]]>
<![%es;[
&chap1-en;
&chap2-en;
...
]]>
</book>
If you wanto to switch from English to Spanish, change the "en" entity
definition from "INCLUDE" to "IGNORE" and change the "es" entity from
"IGNORE" to "INCLUDE".
--
Godoy. <godoy@conectiva.com.br> GPG Fingerprint
851B B620 626D 2AD0 E783
"Ser poeta não é minha ambição, E932 1330 BE6D A4A3 0625
é minha maneira de estar sozinho"
- Fernando Pessoa. Publicações @ Conectiva S.A.
Except where explicitly stated I speak on my own behalf.
Exceto onde explicitado as declarações aqui feitas são apenas minhas.