Closed danielferromeral closed 2 years ago
Hi there. Do you need the modelVersion or the parent version? The //version xpath should have done it for the parent version, but you should also try //project/parent/version. If you want the modelVersion, you should try //modelVersion.
Hello, no, I want the version of the project, not the child of the parent, the 1.3.2.
Did you try to write //modelVersion? What does it do?
Same result:
XPath: //modelVersion File was read successfully. Proceeding to parse DOM. Found 0 nodes. Error: Your xpath did not return any nodes.
Alright. I found it. This happens because the POM xml has a namespace, and XPath doesn't work exactly the same with namespaces. Here's the XPath you can write to get the project version: //*[local-name()='project']/*[local-name()='version']
Yeah, that works. Lots of thanks.
I hade a similar issue. I wanted to read the attribute:
/Package/Identity/@Version
But due to namespaces, I needed to use this query instead:
/*[local-name()='Package']/*[local-name()='Identity']/@Version
Maybe someone finds this useful :-)
Hello.
I'm trying to parse a pom.xml to get the version. The pom looks like this:
And the action looks like this:
And everytime i get this error:
File was read successfully. Proceeding to parse DOM. Found 0 nodes. Error: Your xpath did not return any nodes.
I have tried with //project, //version, //project/version/text(), but all the time I get the same error. Any tips on how to solve it?
Thanks in advance.