On 02/13/2015 01:23 PM, Guk Aleksandra wrote:
I use XMLmind XML Editor version  4.7.0 and now we're going to update
to the 5.6.0 version.
In the previous version I had a customized configuration with some
very useful features.
E.g., I used  "db5.toggleAttribute revisionflag added" to mark some
text and other parameter with the "db5.toggleAttribute" command.
But in 5.6.0 version I haven't command  like "db5.toggleAttribute".
What can I use instead of it?
It is important to mark and unmark text with one hotkey/button.
So I need add/change/remove attribute value. What should I use?


XMLmind XML Editor version 4 and version 5 are no longer supported by us (latest version is version 6.2). Therefore it's very difficult for me to really help you.



This being said:

1) Command "db5.toggleAttribute" was not part of the stock DocBook 5 configuration included in XMLmind XML Editor version v4.7.

It's probably a simple custom macro-command (or a native custom Java command, but this is unlikely) written by *someone* *in* *your* *organization*. You should contact this person and ask her/him to port her/his customization from v4.7 to v5.6.



2) Macro-command "db5.toggleAttribute" can be implemented as follows (in v6, but should also work in v5):

---
<command name="db5.toggleAttribute">
  <macro trace="false">
    <choice>
      <sequence>
        <test context="$implicitElement"
              expression="attribute::%0"/>
        <command name="removeAttribute"
                 parameter="[implicitElement] %0" />
      </sequence>

      <command name="putAttribute"
               parameter="[implicitElement] %0 %1" />
    </choice>
  </macro>
</command>
---

Once macro-command "db5.toggleAttribute" has been implemented, it can be bound for example to hot key F3 as follows:

---
<binding>
  <keyPressed code="F3" />
  <command name="db5.toggleAttribute"
           parameter="revisionflag added" />
</binding>
---



-------------------------------------------------------
References (applies to v6 but should also work for v5):
-------------------------------------------------------

* Customizing an existing configuration -- http://www.xmlmind.com/xmleditor/_distrib/doc/configure/customizing.html

* The "binding" configuration element -- http://www.xmlmind.com/xmleditor/_distrib/doc/configure/binding.html

* Macro commands -- http://www.xmlmind.com/xmleditor/_distrib/doc/commands/macro.html

* Command putAttribute -- http://www.xmlmind.com/xmleditor/_distrib/doc/commands/putAttribute.html

* Command removeAttribute -- http://www.xmlmind.com/xmleditor/_distrib/doc/commands/removeAttribute.html




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

Reply via email to