This plugin allows to enter and evaluate an XPath expression in any XML-document that is opened in IDEA.
It will highlight the resulting nodes in the editor or show the result in a message box if it is an XPath primitive value (string, number, boolean).
I wanted to try out the ProgramStructureInterface API and since I recently had to do some XML processing using XPath, I thought that might be a handy tool...
Just unzip the downloaded zip (xpath-view.zip) file into [IDEA-HOME]/plugins
The plugin was tested with IDEA build #681 on Windows 2000 and Windows XP.
IMPORTANT NOTE
This plugin makes heavy use of IDEA's ProgramStructureInterface API.
The PSI-API is not part of the currently published OpenAPI and therefore completely unsupported by IntelliJ.
In particular, that means that the interface may be changed by IntelliJ without prior notice, causing the plugin to work incorrectly or not to work at all.
The plugin can be activated either by a 2-key keyboard shortcut (ctrl-alt-x + e), the editor popup menu or the main toolbar when the active editor contains an XML document.
Enter an XPath expression and see what happens
- Namespaces: Although queries containing namespace-prefixes are supported, the XPath namespace-axis (namespace::) is currently unsupported.
- String values with string(): Whitespace handling for the string() function is far from being correctly implemented. To produce somewhat acceptable results, all whitespace inside a string is normalized. DON'T EXPECT THESE RESULTS TO BE THE SAME AS WITH OTHER TOOLS.
- This is a limitation for matching text() as well as for the result produced by string(). The only recognized entity refences are the predefined ones for XML:
& < > " In all other cases, the text that is returned is the text shown in the editor and does not include resolved entities. Therefore you will get no/false results when entites are involved. It is currently undecided, whether it makes sense to recurse into resolved entities, because there seems no reasonable way to display the result.
- Maybe some others
- I've got NPE when I execute x-path and the cursor is in the begining of the xml file (on the <?xml version="1.0"?> prolog).
- You can also show stripe markers for the selection.
Thanks for the great plugin!
KeshSibilev
The NPE is fixed in version 0.2, also the stripe markers are incorporated in version 0.2. Thank you!.
SaschaWeinreuter - 05 Nov 2002
Thanks for the great plugin it was indespensible for me throughout the past months, but now I am moving to Aurora (for clearly known reasons ) is this plugin ported to Aurora
-- MamadoInside - 04 Sep 2003
Yep, it is already ported, I just forgot to upload it here. Sorry.
-- SaschaWeinreuter - 25 Sep 2003
0.1 (04 Nov 2002)
0.2 (05 Nov 2002)
- Bugfix: NPE without context node
- Add error stripes to right editor margin for each result
0.3 (22 Nov 2002)
- Fixed whitespace handling: text() no longer matches whitespace
inside start tags (<tag attr="value" >...</tag>)
- Whitespace inside CDATA sections will no longer be normalized for string()
- Implemented parsing of character reference entities
- Implemented entity resolution for predefined xml entities (& < > ")
- Implemented target-based matching for PIs;
string(processing-instruction()) returns PI-data
0.3.1 (27 May 2003) (unavailable)
0.3.2 (25 Sept 2003)
0.3.3 (04 Nov 2003)
- Fixed problem with build #963 that caused different IDEA-dialogs to become unclosable with the [Esc] key.
-- SaschaWeinreuter - 25 Sept 2003
|
|