XML filter: itsx:idValue rule does not work if translatable node has children nodes

4 views
Skip to first unread message

Manuel Souto Pico

unread,
Aug 31, 2022, 11:31:31 AM8/31/22
to okapi-users
Dear all,

I'm trying to match the text node in an XML file as well as its ID as the resname property, e.g.

<label key="THIS_IS_THE_ID">
<text>THIS IS THE TEXT</text>
</label>

I'm using these rules:

<its:translateRule itsx:whiteSpaces="preserve" selector="//text" translate="yes"/>
<its:translateRule itsx:idValue="parent::label/@key" itsx:whiteSpaces="preserve" selector="//text" translate="yes"/>

The xpath `parent::label/@key` seems to work fine with an example like the one above, however it doesn't seem to match the key if the <text> node has other children subnodes (or HTML tags), e.g.

<label key="THIS_IS_THE_ID2">
  <text>
    <div>
      <p>THIS IS THE TEXT</p>
      <img src="./whatever" />
    </div>
  </text>
</label>

I have also tried with `ancestor::label/@key` but to no avail. 

I'm using the fprm file as the filter parameters file of the XML filter in an OmegaT project.

Any tips? Am I doing something wrong?
Thanks a lot.

Cheers, Manuel

PS: Files attached...


okf_xml@oat.fprm
unit-sample.xml

Manuel Souto Pico

unread,
Sep 2, 2022, 4:39:38 AM9/2/22
to okapi-users
Hi there,

I have tried creating XLIFF from Rainbow 1.44 with the same source XML and the same filter parameters file, and I can confirm I can reproduce the issue also in that case.

Shall I create a ticket? Many thanks in advance.

Cheers, Manuel

Chase Tingley

unread,
Sep 2, 2022, 5:23:05 PM9/2/22
to Manuel Souto Pico, okapi-users
I haven't had a chance to try this yet, but I would go ahead and create a ticket. Thanks!

--
You received this message because you are subscribed to the Google Groups "okapi-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to okapi-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/okapi-users/CABm46barBb5w-cyHUDLPk-GJhh85d8-U8RFW8migrTx_bOH1dQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages