Martin Hans wrote:
> 
> I have been trying to get a macro to work in my configuration and it?s 
> really beginning to drive me nuts.
> 
>  
> 
> Currently I?m just trying on the macro below which is a modified version 
> of the example from the docs. (I changed emphasis to strong since I am 
> in an XHTML context).
> 
> Pressing F2 does nothing. 

Please use Options|Preferences, General|Features section and check the 
"Enable the Developers Tools" checkbox. Then restart XXE.

After doing this, you'll find a new "Help|Mouse and Key Bindings" menu 
item. Open a document for which you expect your binding to be active 
then select "Help|Mouse and Key Bindings". You should see F2 associated 
to convertToBold.

(This also adds an "Options|Reload All Configurations" menu item which 
allows you to reload all configurations without having to restart XXE. 
Note that you'll have to close all opened documents if you want to use 
this menu item.)




> I can find the command in Tools -> Execute 
> Command?, but if I try to execute it I simply get ?cannot execute 
> convertToBold?. I had hoped that turning on trace would tell me just 
> *why* the command can not be executed, but it seems to make no 
> difference.

"Cannot execute" always means: "given what you have selected (text or 
nodes, explicitly or implicitly), given the schema to which the document 
is conforming to, there is no way to successfully execute your command; 
therefore I'm not even trying."



> How do you guys do this? I?m running the professional 
> version 3.7.1.

We start XXE from a terminal on Unix and we change javaw to java in 
xxe.bat on Windows. This way, we can see the messages printed by <macro 
trace="true">. These messages are truly useful in the case of a complex 
macro.



>  
> 
>   <binding>
> 
>     <keyPressed code="F2" />
> 
>     <command name="convertToBold" />
> 
>   </binding>
> 
>  
> 
>   <command name="convertToBold">
> 
>     <macro trace="true">
> 
>       <sequence>
> 
>         <command name="convert"
> 
>                  parameter="[implicitElement] strong" />
> 
>       </sequence>
> 
>     </macro>
> 
>   </command>

This macro is really very simple (you could bind the "convert" command 
directly to F2).

It cannot be executed for only two reasons:

* You didn't select something which can be converted to "strong".

* There is no "strong" element at all. That is, you forgot the 
namespace. May be it's something like:
<command name="convert"
parameter="[implicitElement] {http://www.w3.org/1999/xhtml}strong"; />

Note that XXE v3 is not namespace aware when the document being edited 
is conforming to a DTD (in such case "strong" is fine) and is namespace 
aware in all the other cases (in such case, please specify 
"{namespace_URI_here}strong"}.



> 
> BTW ? is there a way to search the mailing list archive? I have been 
> trying to find an answer to the above question from the archives, but it 
> seemed to require that I read the pas 7 years worth of messages, so I 
> gave up after going about a year back in time. Google does not seem to 
> index the archive, so that was no help.

Please use the ``Search box'' found at the top of all the pages of our 
Web site.



Reply via email to