Kevin Flynn wrote:
> It seems to be the case that you cannot use local namespace variables in
> xpathSearch expressions. In other words:
> 
> <cfg:get expression="$view:searchString"/>
> <cfg:command name="xpathSearch"
> parameter="following::*[contains(@id,'%_')][1]" />
> 
> works, but
> 
> <cfg:command name="xpathSearch" parameter="following::*[contains(@id,
> $view:searchString)][1]" />
> 
> doesn't.
> 
> It took me a while to find out that this was the cause of my problems, so
> it's probably worth documenting.

Right. ``$variables'' only work in cfg:get, cfg:set, cfg:test, cfg:match
(and that's not very intuitive, I agree with that).

We'll make that clear in the documentation.



> Incidentally, the reason I am using xpathSearch here rather doing this:
> 
> <cfg:set variable="selectedElement" context="$selectedElement" expression="
> following::*[contains(@id, $view:searchString)][1]"/>
> 
> is that xpathSearch forces collapsed elements to be expanded. 

Yes.



> Is there any
> other way to do this programmatically? If not, can I add it to the wish
> list?
> 

Programmatically? Yes. You can do anything you want in Java[tm]. I
suppose that your question is in fact: how can I do that in a macro?

Answer: use command "toggleCollapsed". See
http://www.xmlmind.com/xmleditor/_distrib/doc/commands/toggleCollapsed.html

Reply via email to