You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by bu...@apache.org on 2002/11/28 17:20:07 UTC

DO NOT REPLY [Bug 14939] New: - Default value not used

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14939>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14939

Default value not used

           Summary: Default value not used
           Product: Xerces2-J
           Version: 2.2.1
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: SAX
        AssignedTo: xerces-j-dev@xml.apache.org
        ReportedBy: guillaume.nobiron@vif.tm.fr


My configuration :
JDK 1.4.1_01 on Windows 2000 SP3

I am parsing an xml file using Xerces 2.2.1 with an XMLSchema.

I have the following exception throwed when I parse an xml file :

java.lang.NumberFormatException: For input 
String: "org.apache.xerces.impl.dv.ValidatedInfo@d02b51"

This exception is thrown when I try to copy the value parsed in an Integer 
type :
   inst = new Integer(attrs.getValue(i)).intValue();

The attribute "inst" from the element "application" is defined as follow ( I 
removed unnecessary attributes) :

  <xs:element name="application">
    <xs:complexType>
      <xs:attribute name="inst" type="xs:integer" default="1"/>
    </xs:complexType>
  </xs:element>

And the exception is thrown when I havn't specified the "inst" element.

With all the previous versions of Xerces (even 2.2.0), the value returned in 
this case was "1". So everything was OK.

I saw a new feature with the uri : 
http://apache.org/xml/features/validation/schema/element-default
I tried to set it the value "false" but It didn't solved my problem.

When I remove the line where I put the value into the variable "inst", my xml 
file is parsed and validated.

Could you tell me how I can use default values with this new version of Xerces ?

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