You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by am...@apache.org on 2008/02/26 20:17:50 UTC

svn commit: r631341 - /xerces/c/branches/xerces-2/src/xercesc/validators/schema/TraverseSchema.cpp

Author: amassari
Date: Tue Feb 26 11:17:50 2008
New Revision: 631341

URL: http://svn.apache.org/viewvc?rev=631341&view=rev
Log:
Rewritten fix for XERCESC-1718 as checking for the validity of all the attributes multiple times would report errors when IDs are used

Modified:
    xerces/c/branches/xerces-2/src/xercesc/validators/schema/TraverseSchema.cpp

Modified: xerces/c/branches/xerces-2/src/xercesc/validators/schema/TraverseSchema.cpp
URL: http://svn.apache.org/viewvc/xerces/c/branches/xerces-2/src/xercesc/validators/schema/TraverseSchema.cpp?rev=631341&r1=631340&r2=631341&view=diff
==============================================================================
--- xerces/c/branches/xerces-2/src/xercesc/validators/schema/TraverseSchema.cpp (original)
+++ xerces/c/branches/xerces-2/src/xercesc/validators/schema/TraverseSchema.cpp Tue Feb 26 11:17:50 2008
@@ -1187,16 +1187,12 @@
                           SchemaSymbols::fgELT_SIMPLETYPE);
         return 0;
     }
-
-    // -------------------------------------------------------------------
-    // Check attributes
-    // -------------------------------------------------------------------
-    unsigned short scope = (topLevel) ? GeneralAttributeCheck::E_SimpleTypeGlobal
-                                      : GeneralAttributeCheck::E_SimpleTypeLocal;
-
-    fAttributeCheck.checkAttributes(
-        childElem, scope, this, topLevel, fNonXSAttList
-    );
+    else if(!topLevel && !nameEmpty) {
+        const XMLCh fgLocal[] = { chLatin_l, chLatin_o, chLatin_c, chLatin_a, chLatin_l, chNull };
+        reportSchemaError(childElem, XMLUni::fgXMLErrDomain, XMLErrs::AttributeDisallowed, 
+                          SchemaSymbols::fgATT_NAME, fgLocal, childElem->getLocalName());
+        return 0;
+    }
 
     if (nameEmpty) { // anonymous simpleType
         name = genAnonTypeName(fgAnonSNamePrefix);
@@ -1219,6 +1215,16 @@
     DatatypeValidator* dv = fDatatypeRegistry->getDatatypeValidator(fullName);
 
     if (!dv) {
+
+        // -------------------------------------------------------------------
+        // Check attributes
+        // -------------------------------------------------------------------
+        unsigned short scope = (topLevel) ? GeneralAttributeCheck::E_SimpleTypeGlobal
+                                          : GeneralAttributeCheck::E_SimpleTypeLocal;
+
+        fAttributeCheck.checkAttributes(
+            childElem, scope, this, topLevel, fNonXSAttList
+        );
 
         // Circular constraint checking
         if (fCurrentTypeNameStack->containsElement(fullTypeNameId)) {



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