Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.0.4

Bug #3149 XML container does not properly handle redundant strings
Submitted: 2005-01-10 07:19 UTC Modified: 2005-01-26 07:33 UTC
From: ylf at xung dot org Assigned: quipo
Status: Closed Package: Translation2
PHP Version: 4.3.4 OS: Linux Debian (testing)
Roadmaps: (Not assigned)    
Subscription  


 [2005-01-10 07:19 UTC] ylf at xung dot org
Description: ------------ With a string doublon in the XML data, Translation2 issues notices/warnings and fail to retrieve the corresponding translation. Reproduce code: --------------- Test source : http://samalyse.com/ln/0003.php XML source : http://samalyse.com/ln/0004.php Expected result: ---------------- EUR : Euro NZD : New Zealand Dollar Actual result: -------------- Notice: Undefined offset: 0 in /usr/share/php/Translation2/Container/xml.php on line 179 Warning: iconv() expects parameter 3 to be string, array given in /usr/share/php/Translation2/Container/xml.php on line 185 Notice: Undefined offset: 1 in /usr/share/php/Translation2/Container/xml.php on line 179 Warning: iconv() expects parameter 3 to be string, array given in /usr/share/php/Translation2/Container/xml.php on line 185 EUR : Euro NZD :

Comments

 [2005-01-11 08:17 UTC] quipo
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better. -- Out of curiosity, was that XML file generated by Translation2?
 [2005-01-11 16:06 UTC] ylf at xung dot org
Absolutely not. I made the doublon myself :-) Trouble is that validating against the DTD doesn't detect that kind of thing. I'm wondering if it wouldn't be nice to have a command line tool to check translation2's xml files. So that you can test them before going online.
 [2005-01-12 17:24 UTC] quipo
> I'm wondering if it wouldn't be nice > to have a command line tool to check > translation2's xml files. So that you > can test them before going online. it certainly would! Any volunteer? :)
 [2005-01-23 16:36 UTC] ylf at xung dot org
Here it is ! t2xmlchk checks and validates XML files intended to be used with the Translation2 internationalization package. Usage: t2xmlchk <xml filename> Grab it at : http://samalyse.com/ln/0007.php First you need to apply dtd_constant.diff, then ensure that you have the latest XML_DTD package, and DTD_Tree 1.1 (not 2.0.0RC2). Enjoy !
 [2005-01-23 16:37 UTC] ylf at xung dot org
(I meant XML_Tree, not DTD_Tree)
 [2005-01-26 07:33 UTC] quipo
great, thanks! I will apply your patch and include the script ASAP.