Hussein, thanks for the info!
When I began to rewrite config file from scratch all things works as they should (even the snippet I sent to the list lately). So I made the typical and frequent error of all IT people: tried to write new config file based on the old template, rather than write it from scratch. Anyway, thanks for you help! P.S. Yes, I was aware about loading of config file, checking the log and cache. I even use <macro trace="true"> and alert command to debug my config. -- ET 2017-10-31 11:39 GMT+03:00 Hussein Shafie <huss...@xmlmind.com>: > On 10/30/2017 04:59 PM, Eduard Tibet wrote: >> >> Hello! >> >> Here is one problem that I can't resolved. >> >> I rewrite a DocBook fast editing configuration addon for v.5.1 (will >> be available to public, when finished and tested). >> >> When I used quite old addon, that I developed for XXE 3.5.2 (yes, I >> know, it is from "ancient" time :) with docbook 4.5 source files, the >> following simple command binding works quite well: >> >> <binding> >> <keyPressed code="S" modifiers="alt"/> >> <command name="insert" parameter="after[implicitElement] section" /> >> </binding> >> >> and inserts new section after the current one (if available) while >> pressing Alt+S. >> >> Unfortunately it doesn't work with docbook 5.1 files because it is a >> NS-aware source. So I went into depths of the RTFM and found out that >> the namespaces should be added with James Clark's notation. > > > That's right. > > > >> >> But such form, as explained here [1]: >> >> <binding> >> <keyPressed code="S" modifiers="alt"/> >> <command name="insert" parameter="after[implicitElement] >> {http://docbook.org/ns/docbook}section" /> >> </binding> > > > This binding in itself looks fine but how do you load it? See very end of > this message. > > > >> >> also doesn't work. > > > If it does not work, it's simply because the DocBook 5.1 schema forbids you > from inserting a section given the currently explicit or implicit selection. > For example, please select the last paragraph or sub-section of a section > and pressing Alt-S will create a new sub-section. > > > > If you replace command "insert" by command "add", Alt-S will work in more > (but not all) selection contexts. See > http://www.xmlmind.com/xmleditor/_distrib/doc/commands/add.html > > > > More generally, it's a good idea to take a look to the stock configuration > files to get some inspiration. > > See XXE_install_dir/addon/config/docbook5/docbook5_support.incl (also > applies to v5.1): > > --- > <separator/> > <item label="section" command="add" > parameter="after[implicitElement] > {http://docbook.org/ns/docbook}section" /> > --- > > See XXE_install_dir/addon/config/docbook5/docbook5_support_base.incl (also > applies to v5.1) for a sample *macro* using both "add" and "insert": > > --- > <!-- This macro is required because a para can contain > lists, tables, etc. --> > > <command name="db5.addAfter"> > <macro> > <choice> > <sequence> > <command name="selectNode" > parameter="ancestorOrSelf[implicitElement] > {http://docbook.org/ns/docbook}para" /> > <command name="insert" parameter="after[implicitElement] %0" /> > </sequence> > <command name="add" parameter="after[implicitElement] %0" /> > </choice> > </macro> > </command> > --- > > > > >> >> The header snippet is: >> >> <article version="5.1" xml:id="some_id_of_article" xml:lang="ru" >> xmlns="http://docbook.org/ns/docbook" >> ... >>> >>> >> >> So, the default namespace for the source is http://docbook.org/ns/docbook. >> >> It is 99% that is my fault that I don't see some note that I should. >> But really digging into the depth of the docs didn't lead me to any >> success. > > > Also make sure that your customization is actually loaded. Open a DocBook > 5.1 document and look at the status log. See > http://www.xmlmind.com/xmleditor/_distrib/doc/help/statusTool.html > > It's easy to forget clearing the "Quick start cache" in which case XXE won't > see your customization. See > http://www.xmlmind.com/xmleditor/_distrib/doc/help/advancedOptions.html#cacheOptions > > > > > >> >> If anyone knows, where I should fix it, it would be great. >> >> [1] >> http://www.xmlmind.com/xmleditor/_distrib/doc/commands/commandref.html#selectednode >> > -- XMLmind XML Editor Support List xmleditor-support@xmlmind.com http://www.xmlmind.com/mailman/listinfo/xmleditor-support