GNOME Bugzilla – Bug 316487
SAX2: & entity translated in & for attribute's value (expected just '&')
Last modified: 2005-09-16 16:15:22 UTC
Please describe the problem: If the attribute's value contains '&' entity then in SAX startElement handler I get & Though, I expect to get just '&' symbol, like in characters handler, if char data contains & entity. Is there any way to get FULLY translated & entity to '&' for attribute's value? BTW, Expat translates it to '&'. Steps to reproduce: 1. Create the following XML file: <?xml version="1.0" encoding="UTF-8"?> <csta:connID> <a attr="AT&T">R&D</a> </csta:connID> 2. Run testSAX program with this XML file. 3. See the output for attribute a: SAX.startElement(a, attr='AT&T') Actual results: Expected results: I would like to see SAX.startElement(a, attr='AT&T') Does this happen every time? Yep Other information:
SAX sucks, it doesn't allow to carry entities values in attributes. You hit libxml2 workaround the API problem. Just run the parser in entity substitution mode. Daniel
Thanks, I knew you should have something for this! ;)
*** Bug 316489 has been marked as a duplicate of this bug. ***