--> XPath expression:

(descendant::*|following::*)[@Name='xxx'][1]

should allow to use "Esc g" to move from one match to the following one and this, regardless of the complexity of your XML document.

Note that "Esc g" should be usable whether xpathSearch has been invoked interactively ("Find Element") or through a macro.




--> Sorry but the current "Find Element" facility is deemed useful enough when writing XHTML, DocBook or DITA documents. Therefore, we do not plan to enhance it in the near future.

For us, it's easy to give a customer this kind of answer because, with XXE, you can have almost anything you want provided that you implement it in Java.

Writing a command  which does what you describe below:

in my understanding: highlight all the matches and then allow the user to use left/right arrow buttons to move from one highlighted match to another.

should *not* be technically challenging.

If you don't have a Java programmer handy, then please consider hiring us to implement the specific feature you want in the form of an extension. See http://www.xmlmind.com/xmleditor/customization_service.html

Or, better, sponsor the development of a missing generic feature (more specifications from your part, always pricier but generic, more powerful than ad-hoc extensions, maintained and documented by us).




On 12/14/2012 05:27 PM, Philippe Nobili wrote:
On Fri, 2012-12-14 at 17:04 +0100, Hussein Shafie wrote:


Command xpathSearch evaluates specified XPath expression in the context
of selected node. Therefore if there is no selected node, xpathSearch
cannot be executed. Unless of course, you pass it option [implicitNode]
or option [implicitElement]. Both options should work fine because your
expression starts with '//'.

In summary:

xpathSearch [implicitNode] //*[@Name = 'nx']

should work fine.

Thanks, see my following e-mail, indeed it does.

However, there is a more fundamental issue with element search (and
maybe a track for improvement) that we do not know how to tackle easily
with commands. I'll try to summarize it:

+ Usually we want to trace all elements matching a given search
criteria, in our case *@Name = 'myname*'. Getting the node-set is pretty
obvious with one simple Xpath statement (e.g. from the current/implicit
element: "self-or-descendant::*[@Name = 'myname']"

+ But the hierarchical tree of nodes may be quite complicated, so
starting from the last match to find the next one is not always a very
good option, expecially because all the node-sets have already been
identified at once.

+ Having just a way to move up and down the tree of found matches would
be much easier.

In short, what would really be efficient is to have the same search
behavior as for text nodes from auser points of view:

1. You search for an node-set by issuing either a simple or an advanced
Xpath query
2. One the node-set has been found, the next/previous match simply move
up and down the matching node-set

Otherwise, the "search next" might just be very difficult, or impossible
(?) to write. We do not know if it makes sense to implement this in XXE,
but we might implement it in Java for our needs in the future (unless
your suggest a better idea, wat you will certainly do...).

Many thanks for your time & for your advice.
Best regards.
Philippe.

--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to