Possibility for emtpying the target of an xliff file?

22 views
Skip to first unread message

Marc Mittag

unread,
Jun 3, 2024, 3:12:21 PM6/3/24
to okapi-users
Dear all,

as far as I can see, there is no possibility to parse an existing xliff
1.2 file with Okapi and create a new xliff 1.2 file, where the target
has been emptied, in case its "state" attribute has a specific value
like "new"?

Like in this example

<target xml:lang="de-DE" state="new">TB</target>

"TB" should be removed from the target.

This is not possible so far with Okapi, correct?

best

Marc

Jim Hargrave

unread,
Jun 3, 2024, 3:42:11 PM6/3/24
to Marc Mittag, okapi-users

There is a RemoveTargetStep.

But it would remove all targets.

Jim


This e-mail and any attachments are confidential and intended solely for the intended addressee. If you are not the intended addressee or have received this e-mail in error, please notify Straker immediately, delete it from your system and do not copy, disclose, distribute or otherwise act in reliance upon any part of this e-mail or its attachments. Straker will not be held liable for any damage caused by the message.
Is it necessary to print this email? If you care about the environment like we do, please refrain from printing emails. It helps to keep the environment forested and litter-free.

Marc Mittag

unread,
Jun 3, 2024, 3:54:46 PM6/3/24
to Jim Hargrave, okapi-users

Hi Jim,

thank you very much!

Did not know that and did look only at the filter settings for xliff.

Yet the step help says, it removes either all targets or only those, where the IDs are listed.

So to distinguish by content of the state-attribute of the target tag, if the content should be removed or not is not possible right now, right?

best

Marc

Is it necessary to print this email? If you care about the environment like we do, please refrain from printing emails. It helps to keep the environment forested and litter-free. --
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/b8fb248f-b67f-4598-a5e7-9475def30460%40strakergroup.com.

Jim Hargrave

unread,
Jun 3, 2024, 3:59:19 PM6/3/24
to Marc Mittag, okapi-users

Correct, you would need to add a new code to test  for the "state" property.

Marc Mittag

unread,
Jun 3, 2024, 4:22:24 PM6/3/24
to Jim Hargrave, okapi-users

Hi Jim,

thank you for the info.

I have to evaluate this. Maybe doing some coding here might be an option.

best

Marc

Marc Mittag

unread,
Jun 4, 2024, 4:47:36 AM6/4/24
to Wei Jiang, okapi-users

wow, that sounds like a good idea, Thank you!


best


Marc


On 03.06.24 23:20, Wei Jiang wrote:
Hi Marc,

Before any other way is figured out, it appears that you can use the XSL Transformation step. Attached is a mini demo package.

Good luck!

Wei


From: okapi...@googlegroups.com <okapi...@googlegroups.com> on behalf of Marc Mittag <ma...@marcmittag.de>
Sent: Monday, June 3, 2024 3:12 PM
To: okapi-users <okapi...@googlegroups.com>
Subject: [okapi-users] Possibility for emtpying the target of an xliff file?
 
--
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.

Wei Jiang

unread,
Jun 4, 2024, 4:47:36 AM6/4/24
to Marc Mittag, okapi-users
Hi Marc,

Before any other way is figured out, it appears that you can use the XSL Transformation step. Attached is a mini demo package.

Good luck!

Wei


From: okapi...@googlegroups.com <okapi...@googlegroups.com> on behalf of Marc Mittag <ma...@marcmittag.de>
Sent: Monday, June 3, 2024 3:12 PM
To: okapi-users <okapi...@googlegroups.com>
Subject: [okapi-users] Possibility for emtpying the target of an xliff file?
 
sample.zip

Wei Jiang

unread,
Jun 4, 2024, 4:47:37 AM6/4/24
to Marc Mittag, okapi-users
Indeed. For your other question today, I am sure you can try this step as well. 😉

Good luck!


From: Marc Mittag <ma...@marcmittag.de>
Sent: Monday, June 3, 2024 5:23 PM
To: Wei Jiang <polytr...@hotmail.com>; okapi-users <okapi...@googlegroups.com>
Subject: Re: [okapi-users] Possibility for emtpying the target of an xliff file?
 
Message has been deleted

Axel Becher

unread,
Jun 26, 2024, 2:48:55 PM6/26/24
to okapi-users
Hello Wei, hello Jim,
We have tried this approach successfully within rainbow, although when using the generated BCONF in longhorn it does not work.
 I've played around with the params mentioned in the Documentation but if and what for they need to be added is unclear.
The XSLT is part of the BCONF and the pipeline looks as follows. The first step seems to be completely ignored:

<?xml version="1.0" encoding="UTF-8"?>
<rainbowPipeline version="1"><step class="net.sf.okapi.steps.xsltransform.XSLTransformStep">#v1
xsltPath=/home/axel/TS-4010/sample.xslt
paramList=Lang=${srcLang}$0a$inputFile=${inputPath}
useCustomTransformer.b=false
factoryClass=
xpathClass=
passOnOutput.b=true</step>
<step class="net.sf.okapi.steps.common.RawDocumentToFilterEventsStep"></step>
...


Any help is appreciated ...

Axel
Reply all
Reply to author
Forward
0 new messages