Magnus G?fvert wrote:
> Hussein Shafie wrote:
>> Magnus G?fvert wrote:
>>   
>>> 2. It is written in the MathML plugin documentation Appendix B last
>>> paragraph
>>> <http://www.xmlmind.com/xmleditor/_distrib/doc/mathml/help.pdf> (I
>>> cannot find this file in my local installation) that "Because this
>>> add-on customizes the stock DocBook 5 configuration bundled with XMLmind
>>> XML Editor, it is not possible to install it in conjunction with other
>>> add-ons which also customize the DocBook 5 configuration." Which is
>>> pretty much what I want to do with our local customization. If I
>>> understand correctly, this should still be possible by creating a new
>>> DocBook 5 configuration using the technique described in Appendix B?
>>>     
>>
>> Yes. You need to create a custom DocBook 5 configuration, but you cannot
>> call it "DocBook v5+" as the MathML add-on already creates a custom
>> DocBook 5 configuration called "DocBook v5+".
>>
>>   
> I am somewhat confused by this statement. The lookup rules
> <http://www.xmlmind.com/xmleditor/_distrib/doc/configure/addon_types.html>
> says that: "Configurations loaded from the |addon/| subdirectory of user
> preferences directory have priority over configurations loaded [...]
> from the |addon/| subdirectory of XXE installation directory."
> 
> To my understanding a new configuration is defined with <configuration
> name="Config name" ...> and a configuration is customized by embedding
> the original configuration, like in  the MathML plugin
> addon\mathml_config\db5mml\db5mml.xxe:
> 
> <configuration name="DocBook v5+" mimeType="application/x-docbook-5+xml">
>   <include location="xxe-config:docbook5/docbook5.xxe" />
>   ...
> </configuration>
> 
> Now you and the docs say that this Docbook v5+ configuration cannot be
> customized further, i.e., indicating that this embedding can only be
> done once. In my own customization addon Application
> Data\XMLmind\XMLEditor4\addon\modelon\docbook5.xxe I attempted yet one
> level of reconfiguration of DocBook v5+ by embedding the MathML db5mml.xxe:
> 
> <configuration name="DocBook v5+" mimeType="application/x-docbook-5+xml"
>   xmlns="http://www.xmlmind.com/xmleditor/schema/configuration";>
>   <include location="mathml-config:db5mml/db5mml.xxe" />
>   ...
> </configuration>
> 
> And this seems to work just fine.

Let's call this method [1].


> 
> Out of curiosity I also tried to rename db5mml.xxe to db5mml.incl and
> removed the name from the configuration element:
> 
> <configuration>
>   <include location="xxe-config:docbook5/docbook5.xxe" />
>   ...
> </configuration>
> 
> I then inluded this file in my custom DocBook v5+ configuration shown
> above, to obtain only one level of reconfiguration, according to your
> advice. This also works and seems to be eqvivalent.

Yes. Let's call this method [2].

However any modification made our distributions (core or add-on) to
predates easily upgrading XXE in the future. We clearly do not recommend
modifying our distributions or copying files found in our distributions.
There are always other ways to achieve what you want.



> So, my question is if it is possible to customize of the DocBook v5+ 
> with MathML by embedding db5mml.xxe like I showed above, in contrary to
> what it claimed in the docs. 

Of course, it's possible to do it. What is claimed in the docs is an
attempt to *discourage* local gurus/consultants from doing what you did.

<digression>This is not because we want to make money by selling xe-su
units (http://www.xmlmind.com/xmleditor/customization_service.html).
Selling xe-su units is not a profitable activity. It has been created
because it is more efficient, both for us and for the customer, than
going into lengthy explanations. However experience shows that customers
will only purchase xe-su units when they need a custom command, a custom
gadget or a custom part written in Java[tm]. That is, when they are
somewhat *forced* to purchase xe-su units, because they cannot program
in Java.</digression>




> Or, are there any limitations which I have
> not yet encountered? My test was quite simple and did not excite all
> bells and whistles in XXE and DB5.
> 

[1] works by pure luck. [2] is not recommended for the reasons explained
above.

When several configurations called "DocBook v5+" coexists, unless you
know some dirty tricks, how to guarantee that it's the right one which
will be picked by XXE.

* Configurations found in XXE_user_preferences_dir/addon/ have priority
over those found in XXE_install_dir/addon/. That's logical.

* When you install the MathML addon, nothing guarantees that it will be
installed in XXE_install_dir/addon/. If you try that on Vista, due to
the UAC, it will be silently installed in XXE_user_preferences_dir/addon/.

* Let's suppose we have this situation (common on Vista and 7):

- XXE_install_dir/addon/docbook5/docbook5.xxe contains the stock config,
lowest priority.

- XXE_user_preferences_dir/addon/mathml/db5mml/db5mml.xxe adds MathML
support to DocBook 5, high priority.

- Your own custom config is also called "DocBook v5+".
-- Install it in XXE_install_dir/addon/ and it will not be picked.
-- Install it in XXE_user_preferences_dir/addon/ and *may* *be* it will
be picked.

The dirty trick is to know the following ugly and primitive
disambiguating rule:

Excerpts of "XMLmind XML Editor - Configuration and Deployment,
Deploying XXE, Dynamic discovery of add-ons, Files containing the
add-ons",
http://www.xmlmind.com/xmleditor/_distrib/doc/configure/addon_types.html:
---
Configurations having the same priority are sorted using their file
basenames. Example: file:///opt/xxe/foo/docbook.xxe is tested before
file:///opt/xxe/bar/sdocbook.xxe when trying to detect the class of a
document because docbook.xxe lexicographically precedes sdocbook.xxe.
---

Therefore, it should work fine in all cases if you call the file
containing your own "DocBook v5+" custom config, something like
"0db5mml.xxe". Ugly isn't it?







Reply via email to