Parser Rules(xpath) XML Filetype doesn´t work

Hello,

I would like to create a new file type.
and I added defined parser rules that define what not to translate.
I would like to exclude strings that contain only numbers from the translation.

But it doesn't work.

Parser rules are:

//dd/text() [matches(.,'^\d+$')]

Please give me some advice.

Using Trados Studio 2019 SR2.

Best regards
Satoru

Top Replies

Parents
  • Studio only supports XPath 1.0 so you cannot use regular expressions like this.

    Your best bet is one of these two ways:

    1. set <dd> so it has some structure and can be used to handle embedded content. Then create an embedded content regex rule to select strings that start and end with numbers.  Make that structure and then the element can be excluded, OR
    2. Filter them out in the editor using the display filter.
Reply
  • Studio only supports XPath 1.0 so you cannot use regular expressions like this.

    Your best bet is one of these two ways:

    1. set <dd> so it has some structure and can be used to handle embedded content. Then create an embedded content regex rule to select strings that start and end with numbers.  Make that structure and then the element can be excluded, OR
    2. Filter them out in the editor using the display filter.
Children