[TYPO3-l10nmgr] XML parser problems

Andreas Otto andreas at otto-hanika.de
Thu Jul 22 16:27:49 CEST 2010


Hi,

Sometimes I have to deal with data in L10N Manager exports that origins 
from the CE table in TYPO3.

While it is perfectly legal to have content like

My property|< 3 % |< 3 %

in the CE table because the line will be rendered like

<tr><td>My property</td><td>&lt; 3 %</td><td>&lt; 3 %</td></tr>

Exporting this as XML results in the data being sent to the validation 
part of the XML export $xmlTool->isValidXMLString($dataForTranslation).


<!DOCTYPE dummy [ <!ENTITY nbsp " "> ]><dummy>My property|< 3 % |< 3 
%</dummy>

That piece of XML will not validate due to the appearance of "<".

My idea would be to add the following line to 
class.tx_l10nmgr_CATXMLView.php at line 122.

$dataForTranslation=str_replace('< ','&lt; ',$dataForTranslation);

The main problem is that this will only cover "< " which might be a 
special use case I have with my editors. Besides that it might not cover 
cases where we have a string like "1<2".

Maybe someone has a better idea how to tackle this.


Cheers,
Andreas



More information about the TYPO3-project-l10nmgr mailing list