Eclipse XPath evaluation plugin

Add this URL to your Eclipse Installation to reach this solution's update site.

2023-09 (4.29), 2023-06 (4.28), 2023-03 (4.27), 2022-12 (4.26), 2022-09 (4.25), 2022-06 (4.24), 2022-03 (4.23), 2021-12 (4.22), 2021-09 (4.21), 2021-06 (4.20), 2021-03 (4.19), 2020-12 (4.18), 2020-09 (4.17), 2020-06 (4.16), 2020-03 (4.15), 2019-12 (4.14), 2019-09 (4.13), 2019-06 (4.12), 2019-03 (4.11), 2018-12 (4.10), 2018-09 (4.9), Photon (4.8), Oxygen (4.7), Neon (4.6), Mars (4.5), Luna (4.4), Kepler (4.3), Juno (4.2, 3.8), Previous to Juno (<=4.1), 2023-12 (4.30), 2024-03 (4.31), 2024-06 (4.32), 2024-09 (4.33)

https://raw.githubusercontent.com/stoupa91/eclipse-xpath-evaluation-plugin/master/eclipse-xpath-evaluation-plugin-update-site/

Learn more...
Solution Description

Enables evaluation of XPath expressions against the active text editor containing XML.

Tags: xml, xpath, Namespaces

Additional Details

Eclipse Versions: 2023-09 (4.29), 2023-06 (4.28), 2023-03 (4.27), 2022-12 (4.26), 2022-09 (4.25), 2022-06 (4.24), 2022-03 (4.23), 2021-12 (4.22), 2021-09 (4.21), 2021-06 (4.20), 2021-03 (4.19), 2020-12 (4.18), 2020-09 (4.17), 2020-06 (4.16), 2020-03 (4.15), 2019-12 (4.14), 2019-09 (4.13), 2019-06 (4.12), 2019-03 (4.11), 2018-12 (4.10), 2018-09 (4.9), Photon (4.8), Oxygen (4.7), Neon (4.6), Mars (4.5), Luna (4.4), Kepler (4.3), Juno (4.2, 3.8), Previous to Juno (<=4.1), 2023-12 (4.30), 2024-03 (4.31), 2024-06 (4.32), 2024-09 (4.33)

Platform Support: Windows, Mac, Linux/GTK

Organization Name: Martin Uhlir

Development Status: Production/Stable

Date Created: Tuesday, November 8, 2011 - 02:26

License: BSD

Date Updated: Friday, October 6, 2023 - 10:51

Submitted by: Martin Uhlir

Screenshot
Date Ranking Installs Clickthroughs
November 2024 188/601 43 3
October 2024 166/663 134 9
September 2024 199/642 100 10
August 2024 260/641 47 10
July 2024 268/663 47 14
June 2024 308/681 38 17
May 2024 237/682 76 18
April 2024 213/687 97 9
March 2024 267/694 63 10
February 2024 221/687 84 12
January 2024 290/691 52 7
December 2023 239/671 71 10
View Data for all Listings

Unsuccessful Installs

Unsuccessful Installs in the last 7 Days: 1

Download last 500 errors (CSV)

Marketplace Drag to Install Button

By adding the following code below to your website you will be able to add an install button for Eclipse XPath evaluation plugin.

HTML Code:

Markdown Syntax:

Output:

Drag to your running Eclipse* workspace. *Requires Eclipse Marketplace Client

Reviews Add new review

The plugin works well with well-formed XML but fell in a heap with HTML and XHTML documents. Would be great if this plugin could be more general purpose and able to ignore small semantic issues with less well-formed markup.

Hi,

I tried to install this tool, but I get an error like this:

Unknown Host: http s:// r a w. gith ubus erco ntent.com/s toupa 91/ eclipse-xpa th-evalu ation-p lugin/ma ter/ecli pse-xpath -eval uati on-pl ugin-u pdate -site/co nten t.x ml

r aw.g ithubuse rcon tent.c om

Because Eclipse "Sorry, we do not allow comments to contain external links [URL]. Feel free to edit your post."

I added some" " in the link.

does anyone know the solution to this?

Thanks a lot

Andreas

In reply to by Andreas Buchner

Did you make it work? I've just tried the installation and strangely faced the same problem as you. So I canceled the instalation, re-tried it again and interestingly this time it went through without any problem. Probably just some network issue (DNS issue?). It doesn't seem to be the plugin's problem.

In reply to by Andreas Buchner

I've tried it again. This time on different computer and different network and I managed to install it successfully without any problems. Can you make a new fresh eclipse installation and try to install the plugin through the Eclipse Marketplace? Just to see if there is any issue with your current eclipse installation. I'm running out of other ideas..

I'm learning XPath and looked for an interpreter and this one gave me a first contact with it but apparently it has issues and interpreting XPath functions. Retyping the queries from the video I cannot get a result and in the video it appears well.

Now I've looked at the syntax of the concat function and I don't understand what's going on. Either it states that I can't use a single argument, Either it states that I am restricted on the first one, either it returns only the number of result but does not display the data.

So it seems it is buggy.
You can reproduce what I'm saying by downloading this XML file and trying that query for instance.
Look for Institute for Informatics Georg-August-Universität Göttingen mondial database. They provide an XML file

and the queries:

/mondial/country[population < 10000]/name/concat('Population: ', name)  <- returns no value
concat(/mondial/country[population < 10000]/name,' test ') <- Returns msg "A sequence of more than 1 item is not allowed as the first argument of concat()"
a working query from the video was

/mondial/country[population > 300000000]/name/concat(name,' -> ', population) <- Just returns the number of elements in the resultset but do not display the data.

In reply to by Jean-Jacques Kujawa

Hi, thanks for reporting the issue. I've just found there is really a small bug regarding this. For now when evaluating the XPath query, please make sure the "Pretty Print" is turned off! Therefore uncheck the checkbox on the very right side next to the "Run Query" and "Load Namespaces" buttons. This is causing not showing the results, I will fix this soon.

Nevertheless, beside this small bug, there is another problem with your XPath query. I believe you were talking about this XML file https://www.dbis.informatik.uni-goettingen.de/Mondial/mondial.xml

Lets have a look at your query: /mondial/country[population < 10000]/name/concat('Population: ', name)

1) Here you call the concat function at this level /mondial/country[population < 10000]/name and passing "name" as the second parameter of the concat function doesn't make sence at all. You may want to change the second parameter to "text()" and you'll get the country name instead (in fact that's the textual content of the "name" element.
2) I believe you want get the population of those selected countries. The problem in that XML file is that there are multiple population elements in each of the country elements. And you can only pass an atomic value to the concat function. Therefore you have to select only one "population" element (selecting it either by year attribute) or just the last one being listed in there.
You can try this query and start digging more from it. It gives you the country name and it's population (it selects only the last population element of the coutry element). /mondial/country[population > 300000000]/name/concat('Population: ', ../population[last()], ', Country name: ', text(), ' | ')

I hope, this helps.

using Eclipse Version: 4.4.2
(note: spaces in URL because URL was rejected as spam)
Bad HTTP Request: https : // raw.github.com/stoupa91/eclipse-xpath-evaluation-plugin/master/eclipse-xpath-evaluation-plugin-update-site/#sthash.U3Qmiawq.dpuf/features/eu.musoft.eclipse.xpath.evaluation.plugin_1.4.4.201511010953.jar

I checked this URL in a browser and it is in fact bad - returns 400 Bad Request

In reply to by fred ted

Hi, can you please go in your Eclipse to the Help->Install New Software and click on Available Software Sites and check which URL you have there for the installation of this plugin? In case you have more URLs for this plugin, please remove all of them. Then either install the plugin through the Eclipse marketplace again or add new site by yourself which will point to this URL
https://raw.githubusercontent.com/stoupa91/eclipse-xpath-evaluation-plugin/master/eclipse-xpath-evaluation-plugin-update-site/
I don't know why the other URL (reported by you) doesn't work anymore, but I've just tried this new URL and I was able to install the plugin successfully. Let me know if you will be able to resolve the issue with this.

For those who have been using previous versions of this plugin, please uninstall it and install it again either through Eclipse Marketplace or use this new update site:

https://raw.github.com/stoupa91/eclipse-xpath-evaluation-plugin/master/eclipse-xpath-evaluation-plugin-update-site/

The reason for this is, that the plugin (and its update site) has been moved from Google to Github and it wouldn't get updated to this latest or future releases.

Hi,

I get always an exception when running the namespace loader.
Here are the details:
An internal error occurred during: "Namespace loader".
XPathFactory#newInstance() failed to create an XPathFactory for the default object model: hattp://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryConfigurationException: java.util.ServiceConfigurationError: javax.xml.xpath.XPathFactory: bundleresource://853.fwk1407675409/META-INF/services/javax.xml.xpath.XPathFactory:2: Illegal configuration-file syntax

Any hints for solving the problem?

Kind regards
Helko

In reply to by Anonymous (not verified)

Hi, I believe you are using Java 8, right? It seems the issues is related to this bug https://saxonica.plan.io/issues/1944 in the Saxon library.

As a temporary workaround you can put following line into your eclipse.ini anywhere after the "-vmargs":
-Djavax.xml.xpath.XPathFactory:http://java.sun.com/jaxp/xpath/dom=net.sf.saxon.xpath.XPathFactoryImpl

I've just tested that on my system and it works well with the modified eclipse.ini file. I will try to fix the issue soon though, so the workaround won't be needed. I hope, it helps!

When a file has a default namespace (xmlns="something") without prefix nothing is selectable.

Even when adding manualy the namespace value association with an empty string.

I have to define a prefix and use that prefix all arround...

- does not gather namespace info from the file itself, would be very easy to implement; it's quite tedious to fill it in by hand, esp. taking into account that this info is forgotten when you close the xml file
- would be nice to have options to ignore namespaces, etc.

A list of the returned XPath objects would in some cases be preferable, the raw xml is a lot of clutter if you are looking for all results of a complex query. A simple 'Number of results' in a Text widget would already be a big improvement.
In total: very nice plugin, also without the above request. Great that the namespaces work like they should (a feature that many online XPath evaluators miss or don't implement right).
Drag&Drop from the browser into Indigo also worked fine for me, chiq.

Kind regards, tw

Looks good, I also installed it via Drag&Drop from the browser successfully into Indigo. Why haven't you converted the Google Code Project into EclipseLabs btw., or started there in the first place?

In reply to by Werner Keil

Thanks. Yeah, I think I should have done that. Well, I'll check the possibilities of moving the project under EclipseLabs.