Details
-
Bug
-
Status: Closed
-
Resolution: Fixed
-
2.4.0
-
None
-
Operating System: Linux
Platform: All
-
27947
Description
I have a document which contains a node similar to this one:
<foo dtEnd="bar" dtStart="baz" />
The document has no DTD, so I guess the non-validating parser is in use. The
parser chokes, giving me an error "The attribute 'dtStart' is already used in
element 'foo'." If I change "dtEnd" to "dtEne", say, parsing works. I've
verified that the error can be demonstrated with the StdInParse sample app
inputting just this node.
It appears that dtEnd and dtStart have the same hash when placed into the
fUndeclaredAttrRegistry in (??)XMLScanner.cpp and the resulting collision gives
my error.
I notice that, in version 2.4.0, fUndeclaredAttrRegistry was declared as a
RefHashTableOf<unsigned int> with a hash modulo 509. It looks as if the
attribute name is hashed and used as a key into the map, with only one entry
permitted per bucket, hence the collision with dissimilar names. I'm confused
therefore that the modulo was reduced, first to 131 (IGXMLScanner.cpp v1.45),
then to 7 (v1.55) and seek enlightenment!
Note that the same document will parse successfully on Windows (using the XML4C
v5.2 code branch.)