Hi Community,
In a custom file type for an XLIFF I would like to filter for elements with certain attributes, to exclude them from translation.
However, the attributes contain different numbers, such as those marked with bold:
<trans-unit id="content.5262957">
<source xml:lang="fr-FR"><![CDATA[https://cdn.elucidat.com/5fd24b7fc9ccc/media/98c7c45c7a24bc161bb53cd5628001dc.PNG (For reference only)]]></source>
</trans-unit>
<trans-unit id="content.5262973">
<source xml:lang="fr-FR"><![CDATA[https://cdn.elucidat.com/5fd24b7fc9ccc/media/9d46c04fe792c2ff102b7c76bd779910.PNG (For reference only)]]></source>
</trans-unit>
I tried to define an XPath with regular expression to search for these:
//trans-unit[@id="(content\.)\d+"]
This expression within works if I try it in RegExr, but not Studio:
"(content\.)\d+"
I also tried this but did not work:
//trans-unit[contains(@id=,'content.')]/source
But if I add the below, I can filter out the given segments (but it'd take long to add all of them):
//trans-unit[@id="content.5204295"]
Can you please help, what am I doing wrong?
Thank you!
Greta