#110 xmlparser needs parentheses

closed-works-for-me
None
7
2001-11-16
2001-11-13
jayseye
No

Two additional sets of parenteses are needed, in
xmlparse.c line 3483, under appendAttributeValue(),
as follows:

if ((!isCdata && (poolLength(pool) == 0) ||
(poolLastChar(pool) == 0x20)))

The intent of the existing code is to suppress
multiple spaces, but this gets short-circuited as
currently written:

if (!isCdata && (poolLength(pool) == 0 || poolLastChar
(pool) == 0x20))

The second test is skipped due to the expansion of the
poolLength() and poolLastChar() preprocessor #defines.

The symptom is that multiple spaces are incorrectly
preserved in attribute values. They are suppressed, as
intended, by adding the parenteses.

The same fix should be applied to xmlparse.cpp line
2688.

Discussion

  • jayseye

    jayseye - 2001-11-16
    • priority: 5 --> 7
     
  • Fred L. Drake, Jr.

    Logged In: YES
    user_id=3066

    I presume you're using a DTD and the attribute is declared
    to have a type other than CDATA?

     
  • Fred L. Drake, Jr.

    • assigned_to: nobody --> fdrake
     
  • Fred L. Drake, Jr.

    • status: open --> closed-works-for-me
     
  • Fred L. Drake, Jr.

    Logged In: YES
    user_id=3066

    I cannot reproduce this using either NMTOKENS or IDREFS
    attribute types. The behavior you're expecting is not
    specified for CDATA attributes.

    If you can sample XML which exhibits the bug you describe,
    please either attach it to this report (in which case I'll
    re-open it) or submit a new report.

    Thanks.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks