Answer the question
In order to leave comments, you need to log in
Is it possible to write such an axis shorter?
Good morning!
Condition: find the link only if it is around the image.
I write the condition self::a[descendant::img]
:
Question for educational purposes: is it possible to write this condition shorter?
Thank you!
Answer the question
In order to leave comments, you need to log in
If the goal is to extract from the document all the links inside which are pictures, then the expression:
//a[descendant::img]
is the shortest, because there is no shorthand syntax for the descendant axis.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question