A slightly different requirement to this question
The dictionary stays the same format but grows:
<resources>
<text name="property.to.match">
<en_US>The American translation</en_US>
<en_GB>The British translation</en_GB>
<en>The language localized, but non locale based generic translation</en>
</text>
<text name="other.property.to.match">
<en>The other language localized, but non locale based generic translation</en>
</text
<text name="another.property.to.match">
<en>Second generic property</en>
</text>
<text name="a.label.to.match">
<en>Generic Checkbox label</en>
</text>
<text name="some.text.to.translate">
<en>This text follows a static bit of text</en>
</text>
</resources>
But the document in which I would like to match is more complex:
<html>
<div>Lot's of html</div>
<div>[property.to.match]</div>
<div>
<h1>[other.property.to.match]</h1>
<p><img src="x.jpg" />[another.property.to.match]</p>
<input type="checkbox"/>[a.label.to.match]
<p>Some text that shouldn't be translated followed by [some.text.to.translate]
</div>
</html>
So the matcher needs to be able to find multiple text strings within the */text() that start and end with [] but could be in amongst other nodes and bits of untrnaslated text.
Thanks again
This XSLT 1.0 transformation:
when applied on the following XML document (based on the provided one but made more difficult and challenging -- the last text nodes contains two replacement targets):
produces the wanted, correct result: