Angle brackets not escaped correctly

Issue #975 closed
Xu Lihang created an issue

I am using Tikal to convert docx/xlsx files to xliff files. I am experimenting if it works if the text contains brackets (e.g. <html>)

I found the start angel bracket is escaped but the end bracket is not.

&lt;b>

I have also attatched a sample file.

In addition, I am trying to create an xliff editor. Now, it just edits target text with tags just like plain text. But what if there are plain text which just like xliff tags, how to handle them correctly?

example:

one segment: <g id=”1”>XLIFF has tags like <g>.<g/>

converted to plain text for editing: <g id=”1”>XLIFF has tags like <g>.<g/> (cannot work)

Thanks.

Comments (4)

  1. Chase Tingley

    This behavior is not incorrect. Escaping of > is optional in XML, unless it appears as part of the string ]]>. See section 2.4 of the XML 1.0 spec:

    The ampersand character (&) and the left angle bracket (<) must not appear in their literal form, except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section. If they are needed elsewhere, they must be escaped using either numeric character references or the strings " &amp; " and " &lt; " respectively. The right angle bracket (>) may be represented using the string " &gt; ", and mustfor compatibility, be escaped using either " &gt; " or a character reference when it appears in the string " ]]> " in content, when that string is not marking the end of a CDATA section.

  2. Chase Tingley

    Also, the XLIFF package writer supports optionally escaping this, but I think this is only exposed through Rainbow, not tikal.

  3. Log in to comment