John L. Clark wrote:
> On Wed, Nov 12, 2003 at 03:37:17PM +0100, Hussein Shafie wrote:
> 
>>"read" loads the *content* of specified text file and returns it as its 
>>result.
>>
>>"%_" is the result of last executed command in a macro-command. This 
>>means that each command executed inside a macro-command sets "%_". This 
>>also means that commands which does not return a result (most commands 
>>do not return a result) clears "%_" (that is, it sets it to void).
> 
> 
> [...]
> 
> 
>>The trick is to split your docbook.integrateVersioning macro in 2 
>>pieces: docbook.integrateVersioning and docbook.doIntegrateVersioning
> 
> 
> [...]
> 
> 
>>  <cfg:command name="docbook.doIntegrateVersioning">
>>    <cfg:macro>
>>      <cfg:sequence>
>>        <cfg:command name="docbook.translateChanges" parameter="'%0'" />
>>        <cfg:command name="XXE.edit" parameter="'%0'" />
>>      </cfg:sequence>
>>    </cfg:macro>
>>  </cfg:command>
>>
>>  <cfg:command name="docbook.integrateVersioning">
>>    <cfg:macro>
>>      <cfg:sequence>
>>        <cfg:command name="selectFile" parameter="saveFile" />
>>        <cfg:command name="docbook.doIntegrateVersioning"
>>                     parameter="'%_'" />
>>      </cfg:sequence>
>>    </cfg:macro>
>>  </cfg:command>
> 
> 
> Thanks for the suggestion.  This approach does seem like it should work,
> because of the way the parameters are processed, but using the updated
> configuration file still produces the same results as before.  In
> particular, I see no evidence to suggest that the XXE.edit command is
> ever executed - nothing shows up in the command execution message log
> after 'Copying "/tmp/xxe48576/out.xml" to "/home/user/file.xml" (1/1)'
> 
> In order to experiment, I added the following command to the first
> sequence above, and it successfully executes (a gvim window appears with
> the source to the correctly translated output file).  However, the
> XXE.edit command still seems to do nothing.
> 
>     <cfg:command name="start" parameter="gvim '%0'"/>
> 
> Any suggestions? 

Sorry, it is my fault. I did a mistake in my suggestion.

In:
---
<cfg:command name="XXE.edit" parameter="'%0'" />
---

simply remove the quotes around '%0':
---
<cfg:command name="XXE.edit" parameter="%0" />
---

* Command "XXE.edit" expects a file name or an URL and 
'file:///tmp/foo.xml' *with the quotes* is not a file name or URL.

* A macro command, for example, expects several arguments in its 
parameter string. Quotes must be used for arguments which contains 
whitespaces. That's why, you can, and sometimes you must, quote 
arguments passed to a macro.

* "gvim '%0'" is passed to the shell which has no problems with quotes.



> Any ideas on how I can debug the actions being taken
> within the macro sequence?

Macros in next version of XXE will have a boolean debug attribute.

For now, use the "alert" command. See 
http://www.xmlmind.com/xmleditor/_distrib/docs/poweruser/ar01s05s01.html


Reply via email to