On 07/26/2011 01:25 AM, Andy Black wrote:
> According to the set of changes given on
> http://www.xmlmind.com/xmleditor/changes.html, the selectById command is
> replaced by selectLink.
>
> We have been using selectById within a macro whereby the user chooses an
> item from a list (via the pick command) and we then invoke selectById to
> jump to the indicated item.  It looked like this:
>
> <cfg:command name="jumpToWorkInReferences">
> <cfg:macro>
> <cfg:sequence>
> <cfg:command name="getRefWorkTitlesandIds"/>
> <cfg:command name="RemoveExtraDoubleQuotesFromPickLabelsCmd"
> parameter="%_"/>
> <cfg:command name="pick" parameter="'Jump to reference' true %_"/>
> <cfg:set variable="refWork" expression="%_" plainString="true"/>
> <cfg:command name="bookmark" parameter="add"/>
> <cfg:get expression="$refWork"/>
> <cfg:command name="selectById" parameter="id %_"/>
> </cfg:sequence>
> </cfg:macro>
> </cfg:command>
>
> (Both getRefWorkTitlesandIds and
> RemoveExtraDoubleQuotesFromPickLabelsCmd are custom commands in our
> configuration.)
>
> How can we do something similar now that selectById has been replaced by
> selectLink?
>

selectLink does everything selectById did in terms of link navigation. 
In the above macro, you want to find and select an element having a 
given ID, which is very different from link navigation.

In order to do that, you can use:

<set variable="selectedElement" expression="id('%_')" />

OR:

<command name="xpathSearch" parameter="[implicitNode] id('%_')" />

(The later command not only selects the element and automatically 
scrolls the view to show it, but it will also automatically expand 
collapsed sections if needed to.)

References:

* http://www.xmlmind.com/xmleditor/_distrib/doc/commands/selectLink.html

* http://www.xmlmind.com/xmleditor/_distrib/doc/commands/xpath_vars.html

* http://www.xmlmind.com/xmleditor/_distrib/doc/commands/xpathSearch.html
 
--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to