xerces-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "PeiYong Zhang (JIRA)" <xerces-c-...@xml.apache.org>
Subject [jira] Commented: (XERCESC-1292) multiple occurance of same attributes in Attributes
Date Mon, 01 Nov 2004 15:42:32 GMT
     [ http://nagoya.apache.org/jira/browse/XERCESC-1292?page=comments#action_54884 ]
     
PeiYong Zhang commented on XERCESC-1292:
----------------------------------------

Ralf,

   Actually I've tried to reproduce this on XercesC2_5_0, by adding printf in the SAX2CountHandlers::startElement()
and failed to see the number 2. Can you try the SAX2Count to see if the problem persists?
thanks.

Rgds,
PeiYong

> multiple occurance of same attributes in Attributes
> ---------------------------------------------------
>
>          Key: XERCESC-1292
>          URL: http://nagoya.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://nagoya.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: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Mime
View raw message