From cb6662aea989baeef6565a559b7e0e82708d7dae Mon Sep 17 00:00:00 2001
From: David Abram Cargill <cargilld@apache.org>
Date: Wed, 6 Dec 2006 14:26:57 +0000
Subject: [PATCH] Code cleanup

git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@483090 13f79535-47bb-0310-9956-ffa450edef68
---
 src/xercesc/internal/IGXMLScanner2.cpp            | 2 +-
 src/xercesc/validators/schema/SchemaValidator.cpp | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/xercesc/internal/IGXMLScanner2.cpp b/src/xercesc/internal/IGXMLScanner2.cpp
index 201b90ddb..ccec6e102 100644
--- a/src/xercesc/internal/IGXMLScanner2.cpp
+++ b/src/xercesc/internal/IGXMLScanner2.cpp
@@ -1996,7 +1996,7 @@ Grammar* IGXMLScanner::loadXMLSchemaGrammar(const InputSource& src,
             (
                 root
                 , fURIStringPool
-                , (SchemaGrammar*) grammar
+                , grammar
                 , fGrammarResolver
                 , this
                 , src.getSystemId()
diff --git a/src/xercesc/validators/schema/SchemaValidator.cpp b/src/xercesc/validators/schema/SchemaValidator.cpp
index f2d22a7e6..39276736b 100644
--- a/src/xercesc/validators/schema/SchemaValidator.cpp
+++ b/src/xercesc/validators/schema/SchemaValidator.cpp
@@ -1421,15 +1421,16 @@ SchemaValidator::checkNameAndTypeOK(SchemaGrammar* const currentGrammar,
                                     const ComplexTypeInfo* const baseInfo) {
 
     unsigned int derivedURI = derivedSpecNode->getElement()->getURI();
-    unsigned int baseURI = baseSpecNode->getElement()->getURI();
-    const XMLCh* derivedName = derivedSpecNode->getElement()->getLocalPart();
-    const XMLCh* baseName = baseSpecNode->getElement()->getLocalPart();
 
     // case of mixed complex types with attributes only
     if (derivedURI == XMLElementDecl::fgPCDataElemId) {
         return;
     }
 
+    unsigned int baseURI = baseSpecNode->getElement()->getURI();
+    const XMLCh* derivedName = derivedSpecNode->getElement()->getLocalPart();
+    const XMLCh* baseName = baseSpecNode->getElement()->getLocalPart();
+
     if (!XMLString::equals(derivedName, baseName) || derivedURI != baseURI) {
         ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_NameTypeOK1, fMemoryManager);        
     }
-- 
GitLab