From 0a5de14814f22c150b1601a89371e969d50f04ad Mon Sep 17 00:00:00 2001 From: Khaled Noaman <knoaman@apache.org> Date: Sun, 23 Nov 2003 16:20:16 +0000 Subject: [PATCH] PSVI: pass scope and enclosing type during construction. git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@175432 13f79535-47bb-0310-9956-ffa450edef68 --- .../framework/psvi/XSElementDeclaration.cpp | 21 +++++++------------ .../framework/psvi/XSElementDeclaration.hpp | 17 +++++++++++++++ 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/src/xercesc/framework/psvi/XSElementDeclaration.cpp b/src/xercesc/framework/psvi/XSElementDeclaration.cpp index 294b2e13d..a0f2320dd 100644 --- a/src/xercesc/framework/psvi/XSElementDeclaration.cpp +++ b/src/xercesc/framework/psvi/XSElementDeclaration.cpp @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.7 2003/11/23 16:20:16 knoaman + * PSVI: pass scope and enclosing type during construction. + * * Revision 1.6 2003/11/21 17:29:53 knoaman * PSVI update * @@ -100,14 +103,18 @@ XSElementDeclaration::XSElementDeclaration , XSAnnotation* const annot , XSNamedMap<XSIDCDefinition>* const identityConstraints , XSModel* const xsModel + , XSConstants::SCOPE elemScope + , XSComplexTypeDefinition* const enclosingTypeDefinition , MemoryManager* const manager ) : XSObject(XSConstants::ELEMENT_DECLARATION, xsModel, manager) , fDisallowedSubstitutions(0) , fSubstitutionGroupExclusions(0) , fId(0) + , fScope(elemScope) , fSchemaElementDecl(schemaElementDecl) , fTypeDefinition(typeDefinition) + , fEnclosingTypeDefinition(enclosingTypeDefinition) , fSubstitutionGroupAffiliation(substitutionGroupAffiliation) , fIdentityConstraints(identityConstraints) { @@ -171,20 +178,6 @@ unsigned int XSElementDeclaration::getId() const // --------------------------------------------------------------------------- // XSElementDeclaration: access methods // --------------------------------------------------------------------------- -XSConstants::SCOPE XSElementDeclaration::getScope() const -{ - if (fSchemaElementDecl->getEnclosingScope() == Grammar::TOP_LEVEL_SCOPE) - return XSConstants::SCOPE_GLOBAL; - else - return XSConstants::SCOPE_LOCAL; -} - -XSComplexTypeDefinition *XSElementDeclaration::getEnclosingCTDefinition() const -{ - // REVISIT - return 0; -} - XSConstants::VALUE_CONSTRAINT XSElementDeclaration::getConstraintType() const { if (fSchemaElementDecl->getMiscFlags() & SchemaSymbols::XSD_FIXED) diff --git a/src/xercesc/framework/psvi/XSElementDeclaration.hpp b/src/xercesc/framework/psvi/XSElementDeclaration.hpp index 8f67ee80a..22482fcd7 100644 --- a/src/xercesc/framework/psvi/XSElementDeclaration.hpp +++ b/src/xercesc/framework/psvi/XSElementDeclaration.hpp @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.6 2003/11/23 16:20:16 knoaman + * PSVI: pass scope and enclosing type during construction. + * * Revision 1.5 2003/11/21 17:29:53 knoaman * PSVI update * @@ -120,6 +123,8 @@ public: , XSAnnotation* const annot , XSNamedMap<XSIDCDefinition>* const identityConstraints , XSModel* const xsModel + , XSConstants::SCOPE elemScope = XSConstants::SCOPE_ABSENT + , XSComplexTypeDefinition* const enclosingTypeDefinition = 0 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); @@ -297,8 +302,10 @@ protected: short fDisallowedSubstitutions; short fSubstitutionGroupExclusions; unsigned int fId; + XSConstants::SCOPE fScope; SchemaElementDecl* fSchemaElementDecl; XSTypeDefinition* fTypeDefinition; + XSComplexTypeDefinition* fEnclosingTypeDefinition; XSElementDeclaration* fSubstitutionGroupAffiliation; XSAnnotation* fAnnotation; XSNamedMap<XSIDCDefinition>* fIdentityConstraints; @@ -339,6 +346,16 @@ inline void XSElementDeclaration::setId(unsigned int id) fId = id; } +inline XSConstants::SCOPE XSElementDeclaration::getScope() const +{ + return fScope; +} + +inline XSComplexTypeDefinition *XSElementDeclaration::getEnclosingCTDefinition() const +{ + return fEnclosingTypeDefinition; +} + XERCES_CPP_NAMESPACE_END -- GitLab