-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Activity #2A #5
Comments
Here we have two websites to test the xPath commands in case we don't want to use any software on our computers: https://www.freeformatter.com/xpath-tester.html |
xpath cheatsheet in two different versions |
@cdelbg : I've been playing around with the xpath expression we already have in the "cdelbg-patch1" branch, "activity_2/pregunta2.xml" file, but I get a result I think is wrong. More precisely, if I modify the xpath expression to return the "confirmed_cases" txt instead of the date, as in below:
I get this result:
Which is not the node with the highest "confirmed_cases" number, as you can see below: I'll keep working on this before proceeding with the 2B activity (I wanted to let you know just in case you didn't notice, so we can discuss it further 👍 ) |
Could it be because of the XML version being used? |
Ok, I think I've found a workaround: In xpath 2.0 there is a "max()" function that does the trick without having to build complex xpath expressions (Just tried myself successfully). However, I also had to download the newest version of the "baseX" xml processor from here, which seems to be the only one xpath 2.0 compatible. Afterwards, we can run this (way simpler) query:
Here is the proof: *PS: Xpath 2.0 expressions are also allowed to perform this activity (there is a message in the forum that explicitly says so) |
Here is the final expression that gives what the assessment asks for:
Feel free to try it yourself :) |
I've already documented this activity in the project memory (There is nothing else to do here) |
I've test at xbase (8.6.7 and 9.4.3) as you suggested and https://codebeautify.org/Xpath-Tester unsuccessfully but it's working at https://www.freeformatter.com/xpath-tester.html and Pathology (the one I have installed on my laptop). ps: anyway it's a bit weird as depending on the tool you have different outcomes. |
Here we could share resources related with this activity (bibliography, links, etc), as well as discuss any problem or issue we might face while performing it (English is not mandatory).
The text was updated successfully, but these errors were encountered: