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: inserting literal text files

/ Camille Begnis <camille@mandrakesoft.com> was heard to say:
| I have to insert in my document some literal blocks of text from simple
| text files (typically some code).
| How do I achieve that?
| I tried something like that:
| <!ENTITY % Xsnippet   SYSTEM "fr/snippet.txt">
| <!ENTITY snippet   &Xsnippet;>

That's a bit redundant, it's the same as

  <!ENTITY snippet SYSTEM "fr/snippet.txt">

Unfortunately, this doesn't work. Well, actually, it does
"work", but it doesn't do what you want. ;-) With this
declaration &snippet; is replaced by the content of
fr/snippet.txt, but that document is interpreted as SGML.

Now, you could say

  <!ENTITY snippet SYSTEM "fr/snippet.txt" NDATA "linespecific">

But that won't work either. You can't use &snippet; in your text
if it isn't SGML.

Depending on your processing system, you have a few options. You can
hack an existing element, like ulink

  <ulink role="embed" url="fr/snippet.txt></ulink>

if you can change the processing system to support it.

Personally, I use the following "hack"

  <inlinegraphic fileref="fr/snippet.txt" format="linespecific">

My DSSSL stylesheets support this and the XSL stylesheets support it
with a little post-processing.

The long-term general solution to this problem is XLink.


Norman Walsh <ndw@nwalsh.com>      | Wandering in a vast forest at
http://www.oasis-open.org/docbook/ | night, I have only a faint light
Member, DocBook Editorial Board    | to guide me. A stranger appears
                                   | and says to me: "My friend, you
                                   | should blow out your candle in
                                   | order to find your way more
                                   | clearly." This man is a
                                   | theologian.--Diderot

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

Powered by eList eXpress LLC