After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 316487 - SAX2: & entity translated in &#38 for attribute's value (expected just '&')
SAX2: & entity translated in &#38 for attribute's value (expected just '&')
Status: RESOLVED NOTABUG
Product: libxml2
Classification: Platform
Component: general
git master
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
: 316489 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-09-16 15:42 UTC by abolgar
Modified: 2005-09-16 16:15 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description abolgar 2005-09-16 15:42:49 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&amp;T">R&amp;D</a>
</csta:connID>

2. Run testSAX program with this XML file.
3. See the output for attribute a:

SAX.startElement(a, attr='AT&#38;T')



Actual results:


Expected results:
I would like to see

SAX.startElement(a, attr='AT&T')

Does this happen every time?
Yep

Other information:
Comment 1 Daniel Veillard 2005-09-16 15:51:42 UTC
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
Comment 2 abolgar 2005-09-16 16:14:08 UTC
Thanks, I knew you should have something for this! ;)
Comment 3 abolgar 2005-09-16 16:15:22 UTC
*** Bug 316489 has been marked as a duplicate of this bug. ***