Raymond, Jocelyn wrote:
> I wish I could upgrade to the newest version.  However, it may take
> another year or more before we can.  In the meantime I guess I won't be
> able to do such differentiation in xxe-2.11.  I was hoping that the
> <pass> would work but it always "pass" the command "run" no matter what
> is the parameter.  Perhaps I should try to 'invent' a command only valid
> for Mac so that I can use <pass>.  Also, the <pass> element act more
> like just a "if" and not like "if else" - I am not sure if there is such
> a thing as <if><else> in xxe.
> 

No. The <pass> always succeeds in this case because there is no way to 
know if a shell/bat command may be executed without actually executing it.

XXE has something which is closer to if/then/else than <pass>, it's a 
<choice> of <sequence>s, each <sequence> starting with <test>. Example:

<command name="docb.joinOrDeleteChar">
   <macro>
     <choice>
       <sequence>
         <test
           expression="($dot/ancestor::para or $dot/ancestor::simpara)
                       and not($selected) and not($mark)" />
         <command name="deleteSelectionOrJoinOrDeleteChar"
                  parameter="%0" />
       </sequence>

       <command name="deleteSelectionOrDeleteChar" parameter="%0" />
     </choice>
   </macro>
</command>

The expression attribute of <test> must contain an XPath expression 
returning a boolean.

You may probably (well, may be not with ancient XXE v2.11) check the 
platform running XXE by using standard XSLT/XPath function 
system-property().

See 
http://www.xmlmind.com/xmleditor/_distrib/doc/commands/macro_reference.html 


See also 
http://www.xmlmind.com/xmleditor/_distrib/doc/commands/xpathfunc.html

Reply via email to