Hello Hashnoders! I am wondering if anybody here has current experience, or past experience with XPath, a web standard language designed to let you describe the relationship between nodes in a tree-like document (like HTML!)
All modern web browsers (Edge, FF, Chrome, Safari) support it, so as soon as IE11 support is no longer important we can begin using XPath in the browser anywhere that it helps us select and find elements using JavaScript easier than trying to describe the same relationships using JavaScript's DOM functions.
Have you used XPath in the past? If so what was most useful
Would you use XPath in the browser to help select elements in the document?
It's been a while since I've used XPath (since XML is really falling out of favor). But when I did use it, I really liked it. A very powerful tool.
I mostly used it with XSL Transformations, which are also cool.
I use xpath almost everyday. But not in the browser. I use it in VBScript (scripting language in our product, yes it’s old) to parse/search/extract information out of XMLs which get exchanged with our server.
Mark
I use it a little in SOAP (XML) context. I don't dislike xpath itself, but I wish the SOAP XML thing would be replaced by REST JSON api's, so I can't say I like working with it either.
For browsers, I think you can do pretty much the same things with css selectors, so I don't see it being a big improvement. But it's nice to have, I guess.
xpath can locate parent elements, so it's a bit more powerful than css selectors, but then we all already learned css so it'll probably take a while for xpath to become mainstream, if ever.
EDIT: I also encountered xpath in Selenium, but ended up using css instead since I'm better at that.