Jeff Hooker wrote: > > The following macro calls a custom macro command that hides all of the > content applying to the xpath contained in the parameter. It works fine when > I trigger the commands one at at time from the command dialog box, and they > work fine when I trigger them one at a time from their own menu items, but > when I attempt to string them together into one command like so: > > <commandname="pmc.hideallconditional"> > <macro> > <sequence> > <commandname="pmc.hideall"parameter="(descendant::*|following::*)[...@arch]"/> > <commandname="pmc.selectNode"/> > <commandname="pmc.hideall"parameter="(descendant::*|following::*)[...@document]"/> > <commandname="pmc.selectNode"/> > <commandname="pmc.hideall"parameter="(descendant::*|following::*)[...@review_status]"/> > <commandname="pmc.selectNode"/> > <commandname="pmc.hideall"parameter="(descendant::*|following::*)[...@audience]"/> > <commandname="pmc.selectNode"/> > </sequence> > </macro> > </command> > > the first one fires and then all the following commands fail. I should add > that I don't do anything regarding changing the cursor or screen focus > between commands when I'm testing, and the first step of the pmc.hideall > command is the following macro-command designed to return the focus to the > document's root element so that the next command can fire: > > <commandname="pmc.selectNode"> > <macro> > <sequence> > <commandname="selectNode"parameter="children[implicitElement]"></command> > <commandname="selectNode"parameter="parent"></command> > <commandname="selectNode"parameter="parent"></command> > <commandname="selectNode"parameter="parent"></command> > <commandname="selectNode"parameter="parent"></command> > <commandname="selectNode"parameter="parent"></command> > <commandname="selectNode"parameter="parent"></command> > <commandname="selectNode"parameter="parent"></command> > <commandname="selectNode"parameter="parent"></command> > <commandname="selectNode"parameter="parent"></command> > <commandname="selectNode"parameter="parent"></command> > <commandname="selectNode"parameter="parent"></command> > <commandname="selectNode"parameter="parent"></command> > <commandname="selectNode"parameter="parent"></command> > <commandname="selectNode"parameter="parent"></command> > <commandname="selectNode"parameter="parent"></command> > </sequence> > </macro> > </command> > > Once again, the pmc.selectNode command works when I run it from the command > dialog, but it fails when I run it from a command that has a bunch of > commands in sequence.
--> Add trace="true" to your pmc.selectNode macro and you'll see that in fact, it always fails. A few steps work, eventually selecting the root element, but after that the overall macro fails. And when the first pmc.selectNode fails inside pmc.hideallconditional, the rest of the sequence is not evaluated (which is normal). See http://www.xmlmind.com/xmleditor/_distrib/doc/commands/macro_reference.html --> Selecting the root element is done like this: <commandname="selectRoot"> <macro> <sequence> <set variable="selectedElement" expression="/*" /> </sequence> </macro> </command> See http://www.xmlmind.com/xmleditor/_distrib/doc/commands/xpath_vars.html --> And what about? <command name="pmc.hideall" parameter="//*...@arch]|//*...@document]|//*...@review_status]|//*...@audience]"/> That is, do you really need pmc.hideallconditional?

