[Expat-bugs] [ expat-Bugs-692964 ] Case where expat 1.95.6 doesn't report duplicate attributes.

SourceForge.net noreply at sourceforge.net
Tue Feb 25 10:24:27 EST 2003


Bugs item #692964, was opened at 2003-02-25 10:28
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=692964&group_id=10127

Category: None
Group: None
Status: Open
Resolution: Accepted
Priority: 5
Submitted By: Mark E. (snowballville)
Assigned to: Karl Waclawek (kwaclaw)
Summary: Case where expat 1.95.6 doesn't report duplicate attributes.

Initial Comment:
I believe I found a bug in the Expat parser in
detecting duplicate attributes when using namespaces.
I'm using Expat 1.95.6 with PyXML 0.8.2.

Section 6.3 of the Namespaces 1.1 recommendation
requires that no element have two attributes with the
same expanded name. Expat 1.95.6 does indeed report a
duplicate attribute error with the example given in
that section of the document:
<?xml version="1.1"?>
<x xmlns:n1="http://www.w3.org" 
   xmlns:n2="http://www.w3.org" >
  <bad a="1"     a="2" />
  <bad n1:a="1"  n2:a="2" />
</x>

I've attached a file with the first <bad> element
removed. Expat doesn't report a duplicate attribute
error when processing this file as I believe the
recommendation requires.


----------------------------------------------------------------------

>Comment By: Mark E. (snowballville)
Date: 2003-02-25 13:24

Message:
Logged In: YES 
user_id=684927

Correction: I have used expat 1.95.5 (with pyxml 0.8.1), but
I haven't tested this case with it. I will if you want me
to. I would expect the same result though.


----------------------------------------------------------------------

Comment By: Karl Waclawek (kwaclaw)
Date: 2003-02-25 13:23

Message:
Logged In: YES 
user_id=290026

It looks to me as if this error has always been there,
since the modifications required would be significant.
No need to test 1.95.5.

Karl

----------------------------------------------------------------------

Comment By: Mark E. (snowballville)
Date: 2003-02-25 13:21

Message:
Logged In: YES 
user_id=684927

I just got started with using xml with python, so expat
1.95.6 (installed with pyxml 0.8.2) is the only version I've
used. I could temporarily download to pyxml 0.8.1 (which
includes expat 1.95.5) if you think it informative.


----------------------------------------------------------------------

Comment By: Karl Waclawek (kwaclaw)
Date: 2003-02-25 11:35

Message:
Logged In: YES 
user_id=290026

Had a look. Won't be a quick fix.
The problem function is StoreAtts().

The solution might be to have a separate function
getAttributeIdNS() that looks up attribute id structs
by expanded instead of prefixed name.

But that may require adjustments to other parts of
the code. Hope I have time soon, unless someone else
is quicker.

----------------------------------------------------------------------

Comment By: Karl Waclawek (kwaclaw)
Date: 2003-02-25 10:44

Message:
Logged In: YES 
user_id=290026

Expat only supports XML Namespaces 1.0, but the bug
still applies (section 5.3 of the spec).
Will look into it.

Does this happen with previous versions of Expat?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=692964&group_id=10127



More information about the Expat-bugs mailing list