[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xerces-cvs
Subject:    svn commit: r808822 -
From:       amassari () apache ! org
Date:       2009-08-28 9:10:43
Message-ID: 20090828091043.A4E26238884A () eris ! apache ! org
[Download RAW message or body]

Author: amassari
Date: Fri Aug 28 09:10:43 2009
New Revision: 808822

URL: http://svn.apache.org/viewvc?rev=808822&view=rev
Log:
If a minOccurs/maxOccurs cannot be parsed in a valid integer because it's too big, \
assume it is 500

Modified:
    xerces/c/trunk/src/xercesc/validators/schema/TraverseSchema.cpp

Modified: xerces/c/trunk/src/xercesc/validators/schema/TraverseSchema.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/validators/schema/TraverseSchema.cpp?rev=808822&r1=808821&r2=808822&view=diff
 ==============================================================================
--- xerces/c/trunk/src/xercesc/validators/schema/TraverseSchema.cpp (original)
+++ xerces/c/trunk/src/xercesc/validators/schema/TraverseSchema.cpp Fri Aug 28 \
09:10:43 2009 @@ -53,6 +53,7 @@
 #include <xercesc/dom/DOMText.hpp>
 #include <xercesc/dom/impl/XSDElementNSImpl.hpp>
 #include <xercesc/util/OutOfMemoryException.hpp>
+#include <xercesc/util/NumberFormatException.hpp>
 #include <xercesc/util/XMLEntityResolver.hpp>
 #include <xercesc/util/XMLUri.hpp>
 #include <xercesc/framework/psvi/XSAnnotation.hpp>
@@ -6020,13 +6021,18 @@
         try {
             minOccurs = XMLString::parseInt(minOccursStr, fMemoryManager);
         }
+        catch(const NumberFormatException& e) 
+        {
+            // REVISIT: report a warning that we replaced a number too big?
+            if(e.getCode()==XMLExcepts::Str_ConvertOverflow)
+                minOccurs = 500;
+            else
+                minOccurs = 1;
+        }
         catch(const OutOfMemoryException&)
         {
             throw;
         }
-        catch (...) {
-            minOccurs = 1;
-        }
 
         if (specNode)
             specNode->setMinOccurs(minOccurs);
@@ -6048,13 +6054,18 @@
             try {
                 maxOccurs = XMLString::parseInt(maxOccursStr, fMemoryManager);
             }
+            catch(const NumberFormatException& e) 
+            {
+                // REVISIT: report a warning that we replaced a number too big?
+                if(e.getCode()==XMLExcepts::Str_ConvertOverflow && minOccurs < 500)
+                    maxOccurs = 500;
+                else
+                    maxOccurs = minOccurs;
+            }
             catch(const OutOfMemoryException&)
             {
                 throw;
             }
-            catch(...) {
-                maxOccurs = minOccurs;
-            }
 
             if (specNode)
                 specNode->setMaxOccurs(maxOccurs);



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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic