Are there differences in XML 2 parser rules?

I'm having trouble with setting up the parser rules for the XML 2 file type filter in Trados Studio 2022.

I have the following XLF file, which I would like to parse based on the XML tags for simple replacement. Let's just treat it as a thought experiment Wink

Anyway, the file is detected properly, but I can't get the tags to work correctly. Here are the parsers I have set up:

Trados Studio Project Settings showing parser rules for XML tags with 'x-html-STRONG' treated as inline.

And the contents of the XLF file that I'm trying to get displayed:

Code snippet of XLF file contents with XML tags, including 'x-html-STRONG' for text emphasis.

I am trying to treat the <g> tags with the "x-html-STRONG" value for attribute "ctype" as inline, whereas the other g tags can simply be handled as structure. With the setting above, I would expect to get at least SOME text in my translation editor (e.g. "zu klein ausgelegter Motor"). But nothing is showing up at all.

I'm probably missing something very easy. Does anyone see what it is?

Thanks for any help!

EDIT with more information:

I created the same parser rules in Trados Studio 2021 using the XML Embedded Content filter and the following was output, which would be more in line with what I expected:

Translation editor in Trados Studio displaying text 'zu klein ausgelegter Motor' with 'g' tags as inline.

But of course, what I'm really aiming for is this:

Trados Studio 2021 Project Settings showing parser rules with 'x-html-STRONG' tags treated as inline.

Which actually ties into my question above: Differences between Embedded Content XML file types and XML 2. And also, why was the Embedded Content XML file type removed from Trados Studio 2022 anyway?

Thanks again for any info!



Generated Image Alt-Text
[edited by: Trados AI at 4:48 AM (GMT 0) on 5 Mar 2024]
emoji
Parents Reply Children
  •  

    that's fantastic that you got that working!

    With some assistance from  in support who pointed out my mistake.

    You keep mentioning the "Embedded Content Filetype" and I don't fully understand this.  You also have the ability to use embedded content with the XML2 filetype as well.  So I don't really understand your problem there.

    Namespaces were also used in older versions but it's actually easier to apply them now.  The XLIFF file does use a namespace so the XML2 filetype is handling this correctly.

    The help documentation is here... although not too helpful!

    https://docs.rws.com/980998/337817/trados-studio-2022/xml-namespaces

    But essentially all you need to do is set a prefix that you wish to use for the namespace.  Vlad used p0 and I left it that way but you can use whatever you like.  You can see my testing tool automatically used ns1 for the namespace in which case the xpath would have been:

    //ns1:parentg/ns1:g[@ctype='x-html-STRONG'] 

    In your xliff the namespace is this one:

    xmlns:xsi="www.w3.org/.../XMLSchema-instance"

    So you would add this into the filetype settings:

    Screenshot showing the "Namespace" settings wth a prefix value of "p0" and a Uri value of "p0	urn:oasis:names:tc:xliff:document:1.2".

    A good resource to learn more about namespaces would be https://www.w3schools.com/xml/xml_namespaces.asp

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

    emoji
  • Thanks for all your help!! Slight smile

    >>You keep mentioning the "Embedded Content Filetype" and I don't fully understand this.  You also have the ability to use embedded content with the XML2 filetype as well.  So I don't really understand your problem there.

    Sorry for the confusion. We are within the Trados Studio / WorldServer dynamic. Until recently, we were using WS 11.3.5, which did not support XML 2 file types, so we've never really messed with creating them in Studio. Then we upgraded to a newer version of WorldServer in December that does support XML 2 (kind of, see here). So this is the first time I've ever really worked with XML 2 even though it's been around for a bit.

    With this, I just want to make sure we are ahead of the curve whenever we do lose access to Studio 2021 and the ability to use the Embedded Content XML filter (see here, I've been busy on the forums today Yum).

    Anyway, I'm sorted now. Thanks again for all your help, the link, and the explanation as well. Top as always! Slight smileThumbsup

    emoji