Xpath query

I have this Xml file:


<trans-unit>
<note>Catch this</note>
</trans-unit>
<trans-unit>
<note>Do not catch this</note>
</trans-unit>

This is my Xpath query: //note[not(contains(text(),'Do not catch this'))]

Which works outside of Studio:

Screenshot of Trados Studio showing an XPath query and the XML file with two trans-unit elements, one being highlighted as a result of the query.

..but not in Studio.

Screenshot of Trados Studio parser settings displaying the XPath rule, its translation setting as 'Always translatable', and the tag type as 'structure'.

Any ideas?

Thanks

Samuel



Generated Image Alt-Text
[edited by: Trados AI at 4:42 AM (GMT 0) on 5 Mar 2024]
emoji
Parents Reply
  • The only problem I am facing now is that this method does not work when the HTML Embedded Content Processor is used.

    Hmnn... nothing like being drip fed the requirements.  Interesting how this thread has evolved!

    This indeed will be a problem.  We can across this when we did the MultilingualXML filetype and actually built our own solution to support embedded content in XML in a better way wrt segmentation and being able to benefit from both using an embedded content processor (like html) and also use regex to catch anything the html processor will miss.

    During the development of that filetype we also discussed comments and omitted it for the time being while we waited to see if anyone really wanted that.  I think you are the first person to present a usecase where it would be helpful.  And your usecase is an interesting one!  So we'll take a look at this for a future release... when we get some time as we're ridiculously swamped at the moment.  For now I think you are probably stuck.

    Although as before... providing more details on your requirement and even your filetype settings would be more helpful than drip-feeding the information.  Maybe there will be a solution after all?

    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
Children