XML Parser: Extract meta data from ancestors descendant, having a specific attribute value

I have an xliff 2 file generated by Angular's i18n tool

I am trying to build my own XML parsing rule in Passolo.
I wan't text from the node <note category="description> displayed as a comment in Passolo:

<?xml version="1.0" encoding="UTF-8" ?>
<xliff version="2.0" xmlns="urn:oasis:names:tc:xliff:document:2.0" srcLang="en">
  <file original="ng.template" id="ngi18n">
    <unit id="xxxxxxxxxxxxxxxxxx">
      <notes>
        <note category="description">Pressing this button logs the authenticated user out from the application, ending the current session</note>
        <note category="meaning">sign out button</note>
        <note category="location">app/content.component.html:33,35</note>
      </notes>
      <segment>
        <source>Sign out</source>
      </segment>
    </unit>
  </file>
</xliff>

I am able to extract the source text and id using an XML data element.
But I can't find the correct syntax for extracting the comment through XML meta data:

Trados Studio XML Data Element dialog with 'xlifffileunitsegmentsource' selected and 'id' filled in the ID field. XML Meta Data dialog with a question mark in the Attribute field and 'Set comment' selected in the Action dropdown.

I have tried many combinations, for example:

ancestor::unit/notes/note[attribute::category='description']
ancestor::unit/notes/note[attribute::category='description'][text()]

...but none has worked so far.
Kindly advise the correct syntax.

Regards
Karl



Generated Image Alt-Text
[edited by: Trados AI at 5:18 AM (GMT 0) on 5 Mar 2024]
emoji