time-link / timelink-kleio

Provides translation of files in Kleio notation into XML and other formats. Part of Timelink.
1 stars 0 forks source link

XML export does not escape quote in xml attribute values #3

Closed joaquimrcarvalho closed 1 year ago

joaquimrcarvalho commented 2 years ago

Check the attribute OBS in the kleio element:

<KLEIO STRUCTURE="/kleio-home/system/conf/kleio/stru/gacto2.str" 
              SOURCE="/kleio-home/sources/ucalumni/sources/A/lista-A-00001.cli" 
              TRANSLATOR="gactoxml2.str" WHEN="2022-3-11 14:51:43" 
              OBS=""Generated from Archeevo export file:  database/auc/PT-AUC-ELU-UC-AUC-B-001-001.CSV dated 2022-02-22 14:25"" 
              SPACE="">

The double double quotes generate an error during import. gacto.xml needs to check if characters in attribute values are clean, this is different from the xml clean predicate, which is more generic and can not prevent quotes.

Maybe something like xml_attr_clean(Original,Cleaned).

joaquimrcarvalho commented 2 years ago

See https://stackoverflow.com/questions/3961505/how-can-i-escape-double-quotes-in-xml-attributes-values

joaquimrcarvalho commented 1 year ago

Fixed 22/2/2023 https://github.com/time-link/timelink-kleio/commit/b93b12662846f4fcdf21cce3d5d2360cf26178a4