-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi,
Oh OK I just need to specify a different name attribute for the <relaxng> element. Thanks, got it. If I dare I think maybe a behavior like the one described here could be implemented: http://www.docbook.org/docs/howto/#cust-naming (I think Jirka designed this) By adding a new attribute to the <relaxng> element, we could have something like that: <relaxng compactSyntax="true" encoding="ISO-8859-1" location="dict.rnc" name="http://docbook.org/ns/docbook" version="5.0-subset LSWE-DICT-1.0"/> Likewise the standard DocBook templates provided by XXE should maybe provide the version attribute in the root element. One last question: why are the docbook and docbookxi addons mutually exclusive? Thanks for your patience, Camille. Hussein Shafie a ?crit : > Camille B?gnis wrote: >> I am currently working on a project for which I wrote two DocBook5 >> customizations (one extension using an additional namespace, and a >> subset). In addition, the users will need to author plain DocBook5 >> documents. >> >> So I use something like this in the addon configuration to detect the >> proper configuration, based on filename extension: >> >> <detect> >> <and> >> <fileNameExtension>fct</fileNameExtension> >> <rootElementNamespace>http://docbook.org/ns/docbook</rootElementNamespace> >> </and> >> </detect> >> >> I have two questions here: >> >> 1) As I understand it in the doc, there is no precedence order if >> configuration files are installed in the same directory. In this case, >> how do XXE decides whether to use the customized addon or the plain >> docbook5 addon? > > You cannot/should not rely on the internal behavior of XXE (which I > don't remember) to do this. See below. > >> 2) I have noticed that the first document I load into XXE determines the >> schema to be used for all subsequent documents having the same >> namespace, ignoring the actual schema defined in the addon loaded. > > The <dtd>, <schema> and <relaxng> configuration elements are just used > to specify which grammar to use when there is no directive in the > document or in the document template being opened. > >> While >> I understand the technical rational behind it, it introduces a >> "hysteresis" in the behavior of the application. Is it possible to avoid >> this? > > In order to do what you want: > > * There is no problem having several configuration files in the same > add-on directory. > > * The name of these configurations must *not* be "DocBook" (which will > be reserved to plain DocBook). > > * Each configuration file must have a <detect> element selecting > documents which could not be selected by other DocBook-family > configurations. > > * Your configurations may reuse configuration elements (not <detect> of > course), commands, macros, etc, from the stock DocBook configuration > (no namespace) or from the DocBook5 RELAX NG configuration > (http://docbook.org/ns/docbook namespace). > > * In principle, commands which are specific to DocBook (promote, demote, > CALS table commands, etc) are namespace-agnostic: they do their work > based on local names. > > * DTD, W3C XML Schemas are cached. RELAX NG Schemas are cached too but > with a different, much simpler, behavior. > > The cache needs to associate ``grammar names'' with schema objects or files. > > - A DTD is identified by its public ID. > - A W3C XML Schema is identified by its target namespace. > - A RELAX NG Schema is identified by its name (see > http://www.xmlmind.com/xmleditor/_distrib/doc/configure/relaxng.html). > > Therefore if you want to use the cache, your configurations must be > associated to document types having different ``grammar names''. > > Alternatively, you can disable the schema cache. Example: > "xxe -putpref useDocTypeCache false" > > In a nutshell, even if all your configurations apply to documents > belonging to the DocBook family, you must treat these documents as if > they were not related to DocBook. > > --- > PS: The DocBook, Simplified DocBook and DocBook5 configurations prove > that it works fine and may be used as examples of what to do. > > > -- > XMLmind XML Editor Support List > xmleditor-support at xmlmind.com > http://www.xmlmind.com/mailman/listinfo/xmleditor-support -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEoOYnjv9P65BfOUMRAtK5AKChcZoaXgJrR/PkSG1uC/xgMlgtWQCeIrNR Fy3eQ0H95I55wqIxJqncC28= =LXU+ -----END PGP SIGNATURE----- -------------- next part -------------- A non-text attachment was scrubbed... Name: camille.vcf Type: text/x-vcard Size: 472 bytes Desc: not available Url : http://www.xmlmind.com/pipermail/xmleditor-support/attachments/20060627/1f88b566/attachment.bin

