Perfect.  It took me a while to figure out to switch the view in XXE to 'no
style', but with the xml phrases exposed, I can do everything in XXE.
Hurray.

I played with this a little and found I can have multiple XMLVariable files.
This helps me since I want team leads to manage their string substitutions
independently.

Thanks very much.
clark

-----Original Message-----
From: Hussein Shafie [mailto:[email protected]] 
Sent: Wednesday, March 04, 2009 6:23 AM
To: Clark Karr
Cc: xmleditor-support at xmlmind.com
Subject: Re: [XXE] String substitution in XXE docbooks producing pdf

Clark Karr wrote:
> Your xml file certainly works; my docbook file does not.  
> 
> Your file has:
>      "<para>I want to print "Hi" right here: &howdy; ..."
> While the docbook file I create with XXE has:
>      "<para>I want to print "Hi" right here: &amp;howdy; ..."
> 
> The difference is '&howdy' versus '&amp:howdy'.
> 
> How do I enter '&howdy' using XXE? 

If you type "&howdy;" in XXE, you get "&amp;howdy;" in the XML file 
created by XXE, which corresponds exactly what you typed.

XXE does not work at the XML physical level. You cannot directly create 
a reference to an internal entity with it.




>  I cannot get the include tool to insert
> a reference (apparently I need to nominate another file as the source of
> 'XML variables').
> 
> I'd like an XXE solution; preferably using only docbook files.  If I need
to
> create an 'XML variables' file, how do I do so from within XXE.

Please follow these steps:

[1] Enable the Include tool by turning on "Enable the Include Tool" 
(Options|Preferences, General|Features section). Tell all your users to 
do the same.

[2] Create a DocBook article and call it something like 
MyXMLVariables.xml. This file should be created on a file share that can 
be accessed by all your users. This file should be maintained by you. 
Your users are not supposed to edit it.

[3] In the first blank paragraph, insert one or more phrase elements 
(http://www.docbook.org/tdg/en/html/phrase.html), one phrase by  ``XML 
variable''.

A phrase element contains the string to be substituted. *IMPORTANT* A 
phrase element must have a short but stable and meaningful id attribute.

Example: <phrase id="product">Foo bar</phrase>

[4] Close MyXMLVariables.xml.

[5] Click on button [+] of the include tool and specify the path of 
MyXMLVariables.xml. Tell all your users to do the same.

http://www.xmlmind.com/xmleditor/_distrib/doc/help/includePane.html

[6] Now open another DocBook document where you want to insert a 
variable. For example, click inside a para element where you want to 
insert a reference to your product.

[7] Press Ctrl+Shift-R (Edit|Reference|Insert Reference) then type the 
first few letters of "product" (e.g. "pr") in the include tool (which 
supports autocompletion). Then press Enter to confirm your choice.

A reference to <phrase id="product">Foo bar</phrase> is inserted in your 
document. The inserted phrase element is displayed in blue/gray which 
means that it is read-only.





> 
> I thought the Copy by Ref mechanism might work for us.  I created a
docbook
> with a table of strings to use, but I cannot pick up a text string with a
> Copy by Reference from within XXE.
> 

Copy by Reference works fine too, but is more tedious to use in the case 
of XML variables.




Reply via email to