Hi,

I've recently discovered XMLMind, and am impressed by its customization possibilities. I'm investigating how it can be used in the short term for a TEI-based edition project that will involve a text transcription phase by volunteers. In this context, XMLMind's capabilities for tagless editing and customized menu buttons are looking very promising.

In order to facilitate the editing experience, I would like to implement following key bindings: -DELETE: IF (caret is at last position and there is a following sibling element) THEN unwrap following sibling element ELSE deleteSelectionOrJoinBlockOrDeleteChar -BACKSPACE: IF (caret is at first position and there is a preceding sibling element) THEN unwrap preceding sibling element ELSE deleteSelectionOrJoinBlockOrDeleteChar

That is: if the caret is right before the <add> element in following example:

    <p>This is paragraph containing <add>added text with <del>some deletions</del> as 
well</add>.</p>

When the user hits the DELETE key, I would like to get following output:

    <p>This is paragraph containing added text with <del>some deletions</del> as 
well.</p>

Thanks to the examples, I've been able to figure out immediately how the keys can be bound to the specific commands. Yet, I'm facing two problems when implementing the condition in a macro: 1. How can a condition be specified that tests for the caret position and following/preceding sibling? 2. How can an unwrap action be defined that preserves any elements inside the tag to be removed (this means that the "convert to (text)" function can't be used, since that will convert its content to a string without further tags. I think the suggestion at https://www.mail-archive.com/[email protected]/msg02082.html contains useful pointers for both questions (the $dotOffset variable and the use of <set variable>), but so far I haven't been able to make a useful macro with them. In order to shortcut precious time: has this been done before, and are examples available somewhere?

Best,

Ron

--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to