I wanted to replace wildcards in a control XML-file from a third-party software.
Unfortunately these wildcards also used as attribute values in this XML-file.
I will give you an example:
<control>
<some-tag id="$wildcard1$" version="3.14">
<another-tag id="second_level">stackoverflow rocks!</another-tag>
</some-tag>
<some-tag id="foo" version="$wildcard2$"/>
<some-tag id="bar" version="145.31.1"/>
</control>
I tried to write a generic transformation with parameters to replace the wildcards in the attribute values.
My biggest problem was, that i don't know the attribute name. So i need to match every attribute in the XML file. That is easy but how i match every attribute with a specific value (e.g. $wildcard$) ?