[oXygen-user] docbook variable substitution

George Cristian Bina
Tue Jun 9 01:54:24 CDT 2009

Hi Andrew,

You have two options:
1. entities
2. XInclude
Note that these are not linked to DocBook, you can use them for any XML 

1. You can declare an entity in your DTD or in the DTD internal subset 
like below

<!ENTITY book "Gone With the Wind">

and then use it in your document

I recently read &book;.

2. You can create a text file, let's say book.txt containing

Gone With the Wind

and then you use it in your document with

I recently read <xi:include href="book.txt" parse="text" 

If you declare the XInclude namespace on the document root
then you can write it like

I recently read  <xi:include href="book.txt" parse="text"/>.

Best Regards,
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger

Andrew Harrison wrote:
> Hi,
> Apologies if this is slightly off topic. I have a docbook question. Is  
> there a way to define a variable in docbook and reference it in the  
> text?
> In latex I would do:
> "\newcommand{\book}{Gone With the Wind}"
> then in the text:
> "I recently read \book."
> which would render as
> "I recently read Gone With the Wind."
> I can't seem to find out if this is possible.
> Thanks in advance.
> Andrew
> _______________________________________________
> oXygen-user mailing list
> http://www.oxygenxml.com/mailman/listinfo/oxygen-user

More information about the oXygen-user mailing list