Steve Sarette wrote:
> Hello.
> 
> I'm thinking about purchasing XML Mind profession edition, but before I 
> do I want to make sure about something. I have an absolute requirement 
> to be able to  "variablize" product names. Normally I would just use 
> shared text entities for this (e.g. <!ENTITY myprod "My New Product 
> Name> but XmlMind replaces these on import.
> 
> So I'm wondering if I can achieve the same effect using XInclude. What I 
> would want to do is have a file with all my variables in it, and 
> identify each with an id tag. For example:
> 
> <para><phrase id="myprod">My New Product Name</phrase><phrase 
> id="otherprod">My Other Product Name</phrase>
> 
> and then use XInclude to include the appropriate phrase where necessary 
> in the text body. By reading the product doc and by playing around with 
> the free version of XMLMind, it certainly seems like this should work. 
> However, I'm reluctant to gamble a few hundred dollars only to find out 
> that it doesn't.
> 
> Also, I need to know if this sort of thing will work with the PDF and 
> RTF conversion plug-ins that are available for XmlMind.

I tested this with:

---
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE para PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
   "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd";>
<para>
   <phrase id="myprod">My New Product Name</phrase>
   <phrase id="otherprod">My Other Product Name</phrase>
</para>
---

Note that you need to add a DTD to make XXE recognize id as being an ID 
attribute.

Everything works fine with the Professional Edition, including 
conversion to RTF and PDF.

I created this:

---
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd";>
<article>
   <title>Test</title>

   <sect1>
     <title>Test</title>

     <para>First product <xi:include
href="phrases.xml#myprod"
xmlns:xi="http://www.w3.org/2001/XInclude";
 ></xi:include
 >.</para>

     <para>Second product <xi:include
href="phrases.xml#otherprod"
xmlns:xi="http://www.w3.org/2001/XInclude";
 ></xi:include
 >.</para>
   </sect1>
</article>
---

I just have to warn you that the GUI is a bit tedious to use when you 
repeatedly insert references to different elements found inside the same 
external document. (For example, there is no keyboard shortcut to insert 
a reference to an external document or element.)


Reply via email to