poster wrote: > It would seem that XXE has enough information, based on the schema, to allow > more flexible insertion of new elements. Even if an element is not valid at > the current insertion point, it is often a simple matter to deduce the > nearest ancestor at which such an element can be inserted, and where that > element will appear as a result. > > For example, in XHTML: if I am in a <li> entering the #text field, and would > like to insert a <p>, there is only one nearest place to do so: as a <p> > element AFTER the <li> #text. > > But XXE instad makes _me_ try to insert a <p>, then try to insert-after a > <p>, then move the selection up so I have selected the entire #text element, > and only then allows me to insert the <p>. > > That seems like a lot of work that XXE could greatly help reduce. An > alternative key to C-h, C-I, C-j should allow me to enter any element for > which such an unambiuous insertion point exists, and then go ahead and > insert that element at that point. > > Thoughts? Feasible?
XXE has a generic set of primitive commands and we do not intend to change it. The basic idea is to have a set of primitive commands which is simple, consistent, easy to understand and very precise (i.e. you know exactly what you are doing). These primitive commands are clearly not intended to be convenient to use in all cases. When the document type makes XXE tedious to use, the solution is to write a specific custom command or a specific macro-command. Your XHTML example is a very good one. No, according to the XHTML grammar, there is *not* only one place where you can insert a <p> when the caret is inside a <li>.#text: * Ctrl-I allows to insert a <p> *inside* the <li>.#text which may split the #text in 2 parts. * To insert a <p> *after* the <li>.#text, you can: a] click at the very end of the <li>.#text and use Ctrl-I <p> (= "insert into" <p>) b] OR select the <li>.#text and use Ctrl-J <p> (= "insert after" <p>) Like you, we have found all this to be very tedious to use, that's why we have written a custom command which deals with the fact that XHTML <li>s can directly contain text (in DocBook, for example, <listitem> cannot directly contain text and there is no such problem). This command is called html.addBlock. See http://www.xmlmind.com/xmleditor/_distrib/docs/xhtml/ar01s04.html#d0e513 This command is bound to the "Add p" button of the XHTML toolbar. You can use this command in your own configurations too. For example, it is also used in the W3C XML Schema configuration where namespace-aware XHTML is used to document the schema components.

