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 587663 - Incorrect Attribute-Value Normalization
Incorrect Attribute-Value Normalization
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: general
2.7.3
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2009-07-03 07:46 UTC by sf
Modified: 2009-09-01 07:41 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description sf 2009-07-03 07:46:54 UTC
Please describe the problem:
Section 3.3.3 Attribute-Value Normalization (http://www.w3.org/TR/2008/REC-xml-20081126/#AVNormalize) gives three examples. With xmllint the second example cannot be reproduced.


Steps to reproduce:
Execute "xmllint --format --noent test.xml" with test.xml as follows:

<?xml version="1.0"?>
<!DOCTYPE x [
<!ENTITY d "&#xD;">
<!ENTITY a "&#xA;">
<!ENTITY da "&#xD;&#xA;">
]>
<x x="&d;&d;A&a;&#x20;&a;B&da;"/>



Actual results:
<?xml version="1.0"?>
<!DOCTYPE x [
<!ENTITY d "&#xD;">
<!ENTITY a "&#xA;">
<!ENTITY da "&#xD;&#xA;">
]>
<x x="&#13;&#13;A&#10; &#10;B&#13;&#10;"/>


Expected results:
<?xml version="1.0"?>
<!DOCTYPE x [
<!ENTITY d "&#xD;">
<!ENTITY a "&#xA;">
<!ENTITY da "&#xD;&#xA;">
]>
<x x="  A  B  "/>


Does this happen every time?
Yes.

Other information:
Comment 1 Daniel Veillard 2009-07-03 14:43:47 UTC
Sorry, no. You misread the spec what you expect should only be
the output for an attribute of type NMTOKENS, which is not the
case in your document !
  Try again and read the 3rd column of the example :-)

Daniel
Comment 2 sf 2009-07-04 11:19:03 UTC
I disagree. The third column (CDATA case) in the second example in the spec says #x20 #x20 A #x20 #x20 #x20 B #x20 #x20, which translates to "  A  B  " (mind the number of spaces), not "&#13;&#13;A&#10; &#10;B&#13;&#10;".
Comment 3 Daniel Veillard 2009-08-25 15:22:30 UTC
Okay, agreed, it's a special recursive treatment for the entities replacement
text. Fixed in git, 

  thanks !

Daniel
Comment 4 sf 2009-08-27 15:13:18 UTC
Works for me (2.7.3 patched with http://git.gnome.org/cgit/libxml2/patch/?id=283d50279d2defbcedc940a4261758afa0fe752b).

Thanks
Comment 5 Daniel Veillard 2009-09-01 07:41:12 UTC
Okay :-)