Author: mukulg
Date: Tue Jun  9 12:58:36 2009
New Revision: 782987

URL: http://svn.apache.org/viewvc?rev=782987&view=rev
Log:
improvements as per comments from Khaled Noaman

Modified:
    
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java

Modified: 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
URL: 
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java?rev=782987&r1=782986&r2=782987&view=diff
==============================================================================
--- 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
 (original)
+++ 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
 Tue Jun  9 12:58:36 2009
@@ -820,7 +820,7 @@
                 throw new XNIException(ex.getMessage(), ex);
             }
         }
-        
assertionProcessor.setAttribute("http://apache.org/xml/properties/assert/validator";,
 this);
+        
assertionProcessor.setProperty("http://apache.org/xml/properties/assert/validator";,
 this);
     }
     
 
@@ -2366,7 +2366,10 @@
 
             // invoke the assertions processor method
             if (assertionProcessor != null) {
-                assertionProcessor.startElement(element, attributes, 
assertObject);
+                // construct the augmentations object, for assertions
+                AugmentationsImpl assertAugs = new AugmentationsImpl();
+                assertAugs.putItem("ASSERT", assertObject);
+                assertionProcessor.startElement(element, attributes, 
assertAugs);
             }
         }
 
@@ -2493,6 +2496,26 @@
             }
             fValueStoreCache.endElement();
         }
+        
+        // invoke the assertions processor method
+        if (fSchemaVersion == Constants.SCHEMA_VERSION_1_1 && 
assertionProcessor != null) {
+           try {
+             // create the ElementPSVImpl object, for assertions
+             ElementPSVImpl assertPSVI = new ElementPSVImpl();
+             assertPSVI.fDeclaration = fCurrentElemDecl;
+             assertPSVI.fTypeDecl = fCurrentType;
+             assertPSVI.fNotation = fNotation;
+             assertPSVI.fGrammars = fGrammarBucket.getGrammars();
+                
+             // construct the augmentations object for assertions.
+             // store assertPSVI into the augmentations
+             AugmentationsImpl assertAugs = new AugmentationsImpl();
+             assertAugs.putItem(Constants.ELEMENT_PSVI, assertPSVI);           
     
+             assertionProcessor.endElement(element, assertAugs);
+           } catch (Exception ex) {
+             throw new XNIException(ex.getMessage(), ex);
+           }
+        }
 
         // Check if we should modify the xsi:type ignore depth
         // This check is independent of whether this is the validation root,
@@ -2555,21 +2578,6 @@
             // same here.
             fUnionType = false;
         }
-        
-        // invoke the assertions processor method
-        // TODO: This code should be after Identity constraint checking and
-        //       should create its own PSVIElement and set the grammars info
-        if (fSchemaVersion == Constants.SCHEMA_VERSION_1_1 && 
assertionProcessor != null) {
-            try {
-                // construct the augmentations object, for assertions
-                AugmentationsImpl assertAugs = new AugmentationsImpl();
-                assertAugs.putItem(Constants.ELEMENT_PSVI, fCurrentPSVI);
-                
-                assertionProcessor.endElement(element, assertAugs);
-            } catch (Exception ex) {
-                throw new XNIException(ex.getMessage(), ex);
-            }
-        }
 
         return augs;
     } // handleEndElement(QName,boolean)*/



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

Reply via email to