Knowledgebase: Product > memoQ
CDATA section is "missing" from a file memoQ exported - why?
Posted by P├ęter Botta on 22 January 2015 01:16 PM

Title: CDATA section is "missing" from a file memoQ exported - why?

Symptoms:   You used memoQ to translate an XML file (either as monolingual or multilingual), and the exported file does not contain the same CDATA sections the original file had. Or you used memoQ or other Kilgray products to process any other XML based file (TMX, TBX, etc), and see the same: the original file contained CDATA sections, while the exported result does not.

For example, the original file contained something like this:

<music><![CDATA[Rock & roll]]></music>

And the export result contains soemthing like this:

<music>Rock &amp; roll</music>

Explanation:   

memoQ does not preserve CDATA in any kind of XML it processes, because it does not have to. The thing to understand is that the use of a CDATA section has no "meaning" in itself, it just allows another way of writing the exact same thing. What memoQ exports has the exact same meaning on the XML level: it is just that the XML language gives you two different ways to write the same thing, and memoQ "chooses" one of them.

For example, you can write

<music><![CDATA[Rock & roll]]></music>

...or...

<music>Rock &amp; roll</music>


The two mean exactly the same on the XML level, and must be read as exactly the same by any piece of software that claims to support XML.
When you use the CDATA section, it is arguably more readable for a human, as you do not have to use the ampersand entity.

If any piece of software expects the CDATA to be there and gives errors if CDATA is not used (or behaves differently if it gets the same content syntactically, but without CDATA), that
piece of software has a bug.

For the same reason, Kilgray has no plans to support the "preservation" of CDATA sections.


(3 vote(s))
This article was helpful
This article was not helpful

Comments (0)
Help Desk Software by Kayako support.memoq.com/index.php?