I want to change some attribute values only for some specific element.
For example, is it possible to change @lang only for the books whose price is 29.99 in below XML?
<book>
<title lang="fr">Harry Potter</title>
<price>29.99</price>
</book>
<book>
<title lang="eng">Learning XML</title>
<price>39.95</price>
</book>
This short and simple transformation (no explicit conditionals at all):
when applied on the provided XML (wrapped to a wellformed XML document):
produces the wanted, correct result:
Explanation: Overriding the identity rule for the desired attribute.