Re: XPath expression evaluation question
Brought to you by:
ovidiu
From: Ovidiu P. <ov...@ap...> - 2002-07-21 17:50:11
|
Tony, On 7/21/02 7:54 AM, "A.M...@sa..." <A.M...@sa...> wrote: > > I have been doing some development on xslt-process, and am about to start work > on adding XPath expression evaluation to the debugger using Saxon. Given the > Saxon code, I hope the actual evaluation may not be too complex. What is far > from clear to me is the best way of displaying the output of an evaluation to > the user. If the result is a simple value, it will be easy. However, if the > result is a node set we need a good way of identifying the nodes within the > source tree which have been selected. Possibilities that have occurred to me > (I don't know how easy they would be to program, though) are > 1. Use the speedbar in some way to display a tree which can be expanded and > contracted > 2. Use the source code in the buffer, and highlight the nodes somehow - colour > would be the obvious choice > 3. Number the nodes hierarchically and display a list of the numbers of the > selected nodes > > Does anyone have any other ideas, or views on a suitable way of displaying the > evaluated expression. I think a combination of 1) and 2) would be an interesting option. The result would appear in the speedbar as a tree. When the user clicks on a particular node in the tree, the corresponding elements in the source document can be displayed, perhaps in a different color. One problem with this approach is that you'll need to write code to analyze the source XML and annotate it with Xpath information, so that selecting elements could work fast. I believe this is where the bulk of the code for this approach would be. Regards, Ovidiu |