Philippe Nobili wrote:
> 
> We try to find a clean way to include small text files (a couple of
> ASCII lines) in  <literallayout></literallayout> sections of our DocBook
> documents. Of course, we could do this by mouse selections (cut and
> paste), but the idea is precisely to avoid having to do this and thus to
> be able to update the DocBook file automatically when the text files
> change, just by reloading them in XMLMind.
> 
> We though we could use something similar to the image processing
> add-ons, but we are not sure... Many thanks in advance for any advice or
> hints.

Yes, it would work but fortunately there are more ``natural'' solutions:

--> [Solution #1] Use literallayout/textobject/textdata and specify in
the fileref attribute of textdata the URL of the file containing the
text file.

See http://www.docbook.org/tdg/en/html/textdata.html

In this case, "DocBook|Convert Document" works out of the box if the
extension of text file is:
txt|text|htm|html|xml|h|c|cpp|java|js|tcl|py|pl|rb

--> [Solution #2] Use XInclude with parse="text" (Requires XXE v4+).
More complicated because we don't have a user interface which supports
this feature:

[1] Insert a literallayout.

[2] Select an emphasis (any inline element you can insert in a
literallayout is OK) having an ID.

[3] Ctrl-Shift-C to copy it as reference.

[4] Paste it (Ctrl-V) in the literallayout. Now you have an XInclude
*placeholder*.

[5] Click in the reference to select it and then use
Edit|Reference|Untransclude Reference.

[6] Use the Attributes tool to specify the following attributes: href,
parse="text", encoding.
Also remove the xpointer attribute.

See http://www.w3.org/TR/xinclude/

[7] Use Edit|Reference|Retransclude Reference.

http://www.xmlmind.com/xmleditor/_distrib/doc/help/editMenu.html#referenceMenu


Reply via email to