[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 
vocabulary.

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" 
xmlns:xi="http://www.w3.org/2001/XInclude"/>.

If you declare the XInclude namespace on the document root
xmlns:xi="http://www.w3.org/2001/XInclude"
then you can write it like

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

Best Regards,
George
-- 
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

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