Why search "[" in xpp "{" also given?

Hi there,

I was asked to write a simple script to check certain things including searching special characters like "[" and "]" which are not supposed to exist at all at the final stage. It works except when it searches "[" (and "]") it also comes back with "{" (and "}"). "{" and "}" are supposed to be OK since they are part of macro. Like the screen cap below. Why is that? Is there a way say using character code (the number is ??) or other I can do this?

 

Screenshot of Trados Studio interface showing an error message with special characters highlighted in red. 

 

We are using XPP 8.4C.1 SP#5 and here is the code I use for searching ..

# check '['
if ($l =~ /\[/) {

...

}

# check ']'
if ($l =~ /\]/) {

....

}

 

Appreciate if anyone can help and many thanks in advance. Kwan



Generated Image Alt-Text
[edited by: Trados AI at 5:10 AM (GMT 0) on 5 Mar 2024]
emoji
Parents
  • Hi,

    I am assuming that you are not using XPP in XML mode but that you are using the system in 'classic' mode.

    You can verify this by looking at the field called 'Enable XML or SGML Processing' in the jobticket. When using classic mode this field is set of 'off' 

    If you are using Classic mode, have a look at how your data gets exported by XPP to the xyascii format and you will understand what is happening:

    the '[' characters gets exported as '\['

    the '{' characters gets exported as '|P['

    (the bare [ and { characters have a special meaning in the xyascii format, a bare { is used as the start tag character and a bare [ is used for representing xyp codes like edit traces - see the manual Transforming Data for more info)

    So when you are just looking for the '[' character you will find that for both the [ and the { character. 

    In order to look for the xyascii representing a [ character, you can modify your perl code to:
    if ($l =~ /\\\[/) { ... }

Reply
  • Hi,

    I am assuming that you are not using XPP in XML mode but that you are using the system in 'classic' mode.

    You can verify this by looking at the field called 'Enable XML or SGML Processing' in the jobticket. When using classic mode this field is set of 'off' 

    If you are using Classic mode, have a look at how your data gets exported by XPP to the xyascii format and you will understand what is happening:

    the '[' characters gets exported as '\['

    the '{' characters gets exported as '|P['

    (the bare [ and { characters have a special meaning in the xyascii format, a bare { is used as the start tag character and a bare [ is used for representing xyp codes like edit traces - see the manual Transforming Data for more info)

    So when you are just looking for the '[' character you will find that for both the [ and the { character. 

    In order to look for the xyascii representing a [ character, you can modify your perl code to:
    if ($l =~ /\\\[/) { ... }

Children