Message:

  A new issue has been created in JIRA.

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/XERCESC-1292

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XERCESC-1292
    Summary: multiple occurance of same attributes in Attributes
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: Xerces-C++
 Components: 
             SAX/SAX2
   Versions:
             2.5.0

   Assignee: 
   Reporter: Ralf Kubiza

    Created: Wed, 20 Oct 2004 8:21 AM
    Updated: Wed, 20 Oct 2004 8:21 AM
Environment: Sun Solaris 8,Sun Workshop 6 Update 2

Description:
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.









---------------------------------------------------------------------
JIRA INFORMATION:
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]

Reply via email to