XLIFF Writer doesn't escape XML entities in context metadata
This looks like an issue with the XLIFF writer rather than the JSON filter. With source like this:
{
"value": "Hello world",
"meta": "Cats & Dogs"
}
and a filter configuration that extracts the meta
field as metadata, we XLIFF (either via Tikal, or Rainbow kit) that has unescaped entities in the context-group:
<trans-unit id="tu1" resname="value" xml:space="preserve">
<source xml:lang="en">Hello world</source>
<target xml:lang="fr">Hello world</target>
<context-group><context context-type="meta">Cats & Dogs</context></context-group>
</trans-unit>
Reproduce using the attached and
$ tikal.sh -fc okf_json@meta.fprm -x test.jso
Comments (5)
-
-
reporter Hmm, maybe my build is stale - I will try again in the morning.
-
@Chase Tingley the escaping of entities has been implied since cf5c4c92 commit -
the main reason was “add default EncoderManager to XliffWriter” (please refer to
net.sf.okapi.common.filterwriter.XLIFFWriter#getEncoderManager
for more details). So, the initialised encoder manager was used for writing innet.sf.okapi.common.annotation.XLIFFContextGroup.Context#toString
. -
reporter @Denis Konovalyenko You’re right. I retested with a build that contained Jim’s commit and it worked. I will close this.
-
reporter - changed status to invalid
Fixed by cf5c4c92
- Log in to comment
@Chase Tingley I have taken a quick look at this and have to admit that with the latest
dev
I have got a bit different extraction (XML entities escaped):Also, please notice the
context-type
differences:meta
VSx-meta
. Maybe, there was some related work done - will take a closer look at this.