What is an alternative to this XPath //div[@id='foo']
in GPath? In general, where I can find this documentation?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Here is the corresponding snippet:
A few other links you may want to read:
The previous poster gave you all that's required: Assuming your document has been slurped into
xml
, you wantto find a single result. Or
findAll
to find all results.To mimic the expression //div[@id='foo'] the closest thing you can do with a GPath is:
the '**' is pretty much the same as '//' in your XPath.
will yield all the nodes of type div at any level.
Later filtering with findAll() with the given closure you get a list of nodes as you do in the XPath case
what you need is this:
its the double * that will let you find it without knowing the path. At least this is how I do it.