[ http://issues.apache.org/jira/browse/XERCESC-1292?page=comments#action_57420 ] cargilld commented on XERCESC-1292: -----------------------------------
Were you able to reproduce this using SAX2Count? If not lets close this bug. > multiple occurance of same attributes in Attributes > --------------------------------------------------- > > Key: XERCESC-1292 > URL: http://issues.apache.org/jira/browse/XERCESC-1292 > Project: Xerces-C++ > Type: Bug > Components: SAX/SAX2 > Versions: 2.5.0 > Environment: Sun Solaris 8,Sun Workshop 6 Update 2 > Reporter: Ralf Kubiza > > If you have a schema like this : > ... > <xsd:element name="someElement"> > <xsd:complexType> > <xsd:attribute name="someNumber" type="xsd:int" use="optional" default="0"/> > </xsd:complexType> > </xsd:element> > ... > and you have an instance of "someElement" like this: > <someElement someNumber="3"> > .. > </someElement> > and then you want to process the attributes of an instance of > "someElement" with code like this : > void processAttributes(const Attributes& attrs) > { > const XMLCh* attrName; > const XMLCh* attrValue; > unsigned int noOfAttrs = attrs.getLength(); > unsigned int index; > char* l_cptrAttrName = NULL; > for ( index=0 ; index < noOfAttrs ; ++index ) > { > attrName = attrs.getQName(index); > attrValue = attrs.getValue(index); > doSomeThing( attrName, attrValue ); > } > } > There is an unexpected behaviour now in version 2.5.0: > noOfAttr is 2 !! In the first loop the value of someNumber is 3. > And in the second loop the value is 0 that may override the correct > value 3. > If you remove the default="0" phrase in the schema, then processing is > correct as expected with noOfAttrs=1 and value=3. > For me this is an error is new in version 2.5.0 and not in version 2.3.0. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]