Author: borisk
Date: Tue Nov 10 07:08:59 2009
New Revision: 834367

URL: http://svn.apache.org/viewvc?rev=834367&view=rev
Log:
Do not complain that the XSD namespace is not imported (XERCESC-1896).

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=834367&r1=834366&r2=834367&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/validators/schema/TraverseSchema.cpp (original)
+++ xerces/c/trunk/src/xercesc/validators/schema/TraverseSchema.cpp Tue Nov 10 
07:08:59 2009
@@ -3155,7 +3155,7 @@
   *         base = QName
   *         id = ID
   *         {any attributes with non-schema namespace . . .}>
-  *         Content: (annotation?, (simpleType?, 
+  *         Content: (annotation?, (simpleType?,
   *                  (minExclusive | minInclusive | maxExclusive | 
maxInclusive | totalDigits | fractionDigits | length | minLength | maxLength | 
enumeration | whiteSpace | pattern)*))
   *       </restriction>
   *
@@ -5050,6 +5050,14 @@
 
     if (baseValidator == 0) {
 
+        // Check if the base is from the schema for schema namespace
+        //
+        if (XMLString::equals(uri, SchemaSymbols::fgURI_SCHEMAFORSCHEMA))
+        {
+            reportSchemaError(elem, XMLUni::fgXMLErrDomain, 
XMLErrs::TypeNotFound, uri, localPart);
+            return 0;
+        }
+
         SchemaInfo::ListType infoType = SchemaInfo::INCLUDE;
         SchemaInfo* saveInfo = fSchemaInfo;
         unsigned int         saveScope = fCurrentScope;
@@ -6021,7 +6029,7 @@
         try {
             minOccurs = XMLString::parseInt(minOccursStr, fMemoryManager);
         }
-        catch(const NumberFormatException& e) 
+        catch(const NumberFormatException& e)
         {
             // REVISIT: report a warning that we replaced a number too big?
             if(e.getCode()==XMLExcepts::Str_ConvertOverflow)
@@ -6054,7 +6062,7 @@
             try {
                 maxOccurs = XMLString::parseInt(maxOccursStr, fMemoryManager);
             }
-            catch(const NumberFormatException& e) 
+            catch(const NumberFormatException& e)
             {
                 // REVISIT: report a warning that we replaced a number too big?
                 if(e.getCode()==XMLExcepts::Str_ConvertOverflow && minOccurs < 
500)
@@ -6458,7 +6466,7 @@
             baseDTValidator = getDatatypeValidator(uriStr, localPart);
 
             if (!baseDTValidator) {
-                reportSchemaError(elem, XMLUni::fgXMLErrDomain, 
XMLErrs::InvalidNSReference, uriStr);
+                reportSchemaError(elem, XMLUni::fgXMLErrDomain, 
XMLErrs::BaseTypeNotFound, baseName);
                 throw TraverseSchema::InvalidComplexTypeInfo;
             }
         }
@@ -6480,7 +6488,7 @@
             if (!baseComplexTypeInfo) {
                 SchemaInfo* impInfo = 
fSchemaInfo->getImportInfo(fURIStringPool->addOrFind(uriStr));
 
-                if (!impInfo) 
+                if (!impInfo)
                 {
                     reportSchemaError(elem, XMLUni::fgXMLErrDomain, 
XMLErrs::BaseTypeNotFound, baseName);
                     throw TraverseSchema::InvalidComplexTypeInfo;



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to