You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "cargilld (JIRA)" <xe...@xml.apache.org> on 2005/08/10 12:19:35 UTC

[jira] Resolved: (XERCESC-1292) multiple occurance of same attributes in Attributes

     [ http://issues.apache.org/jira/browse/XERCESC-1292?page=all ]
     
cargilld resolved XERCESC-1292:
-------------------------------

    Resolution: Fixed

Closing, since no response to provide additional information required.
David

> 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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org