You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ca...@apache.org on 2005/08/11 15:53:18 UTC

svn commit: r231456 - in /xerces/c/trunk/src/xercesc/validators/schema: PSVIDefs.hpp SchemaAttDef.cpp SchemaAttDef.hpp SchemaElementDecl.cpp SchemaElementDecl.hpp

Author: cargilld
Date: Thu Aug 11 06:53:15 2005
New Revision: 231456

URL: http://svn.apache.org/viewcvs?rev=231456&view=rev
Log:
Remove deprecated uppercase enums that were conflicting with other products and the related methods that call them.

Modified:
    xerces/c/trunk/src/xercesc/validators/schema/PSVIDefs.hpp
    xerces/c/trunk/src/xercesc/validators/schema/SchemaAttDef.cpp
    xerces/c/trunk/src/xercesc/validators/schema/SchemaAttDef.hpp
    xerces/c/trunk/src/xercesc/validators/schema/SchemaElementDecl.cpp
    xerces/c/trunk/src/xercesc/validators/schema/SchemaElementDecl.hpp

Modified: xerces/c/trunk/src/xercesc/validators/schema/PSVIDefs.hpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/validators/schema/PSVIDefs.hpp?rev=231456&r1=231455&r2=231456&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/validators/schema/PSVIDefs.hpp (original)
+++ xerces/c/trunk/src/xercesc/validators/schema/PSVIDefs.hpp Thu Aug 11 06:53:15 2005
@@ -22,23 +22,6 @@
 class VALIDATORS_EXPORT PSVIDefs
 {
 public:
-    enum Validity {
-        UNKNOWN = 1,
-        INVALID = 2,
-        VALID   = 3
-    };
-    
-    enum Validation {
-        NONE    = 1,
-        PARTIAL = 2,
-        FULL    = 3
-    };
-
-    enum Complexity {
-        SIMPLE  = 1,
-        COMPLEX = 2
-    };
-
     enum PSVIScope
     {
         SCP_ABSENT    // declared in group/attribute group

Modified: xerces/c/trunk/src/xercesc/validators/schema/SchemaAttDef.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/validators/schema/SchemaAttDef.cpp?rev=231456&r1=231455&r2=231456&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/validators/schema/SchemaAttDef.cpp (original)
+++ xerces/c/trunk/src/xercesc/validators/schema/SchemaAttDef.cpp Thu Aug 11 06:53:15 2005
@@ -43,13 +43,9 @@
 SchemaAttDef::SchemaAttDef(MemoryManager* const manager) :
     XMLAttDef(XMLAttDef::CData, XMLAttDef::Implied, manager)
     , fElemId(XMLElementDecl::fgInvalidElemId)
-    , fValidity(PSVIDefs::UNKNOWN)
-    , fValidation(PSVIDefs::NONE)
     , fPSVIScope(PSVIDefs::SCP_ABSENT)    
     , fAttName(0)
-    , fDatatypeValidator(0)
-    , fAnyDatatypeValidator(0)
-    , fMemberTypeValidator(0)
+    , fDatatypeValidator(0)    
     , fNamespaceList(0)
     , fBaseAttDecl(0)
 {
@@ -62,13 +58,9 @@
                           , const XMLAttDef::DefAttTypes defType
                           , MemoryManager* const         manager) :
     XMLAttDef(type, defType, manager)
-    , fElemId(XMLElementDecl::fgInvalidElemId)
-    , fValidity(PSVIDefs::UNKNOWN)
-    , fValidation(PSVIDefs::NONE)
+    , fElemId(XMLElementDecl::fgInvalidElemId)  
     , fPSVIScope(PSVIDefs::SCP_ABSENT)
-    , fDatatypeValidator(0)
-    , fAnyDatatypeValidator(0)
-    , fMemberTypeValidator(0)    
+    , fDatatypeValidator(0)      
     , fNamespaceList(0)
     , fBaseAttDecl(0)
 {
@@ -85,13 +77,9 @@
                           , MemoryManager* const         manager) :
 
     XMLAttDef(attValue, type, defType, enumValues, manager)
-    , fElemId(XMLElementDecl::fgInvalidElemId)
-    , fValidity(PSVIDefs::UNKNOWN)
-    , fValidation(PSVIDefs::NONE)
+    , fElemId(XMLElementDecl::fgInvalidElemId) 
     , fPSVIScope(PSVIDefs::SCP_ABSENT)
-    , fDatatypeValidator(0)
-    , fAnyDatatypeValidator(0)
-    , fMemberTypeValidator(0)
+    , fDatatypeValidator(0)        
     , fNamespaceList(0)
     , fBaseAttDecl(0)
 {
@@ -104,13 +92,9 @@
               other->getDefaultType(), other->getEnumeration(),
               other->getMemoryManager())
     , fElemId(XMLElementDecl::fgInvalidElemId)
-    , fValidity(other->fValidity)
-    , fValidation(other->fValidation)
     , fPSVIScope(other->fPSVIScope)
     , fAttName(0)
-    , fDatatypeValidator(other->fDatatypeValidator)
-    , fAnyDatatypeValidator(other->fAnyDatatypeValidator)
-    , fMemberTypeValidator(other->fMemberTypeValidator)
+    , fDatatypeValidator(other->fDatatypeValidator)       
     , fNamespaceList(0)
     , fBaseAttDecl(other->fBaseAttDecl)
 {
@@ -155,15 +139,11 @@
     if (serEng.isStoring())
     {
         serEng<<fElemId;
-        serEng<<(int)fValidity;
-        serEng<<(int)fValidation;
         serEng<<(int)fPSVIScope;
 
         serEng<<fAttName;
 
-        DatatypeValidator::storeDV(serEng, fDatatypeValidator);
-        DatatypeValidator::storeDV(serEng, fAnyDatatypeValidator);
-        DatatypeValidator::storeDV(serEng, (DatatypeValidator*)fMemberTypeValidator);
+        DatatypeValidator::storeDV(serEng, fDatatypeValidator);                
 
         /***
          * Serialize ValueVectorOf<unsigned int>
@@ -176,21 +156,13 @@
     {
 
         serEng>>fElemId;
-        int i;
-        serEng>>i;
-        fValidity = (PSVIDefs::Validity)i;
-
-        serEng>>i;
-        fValidation = (PSVIDefs::Validation)i;
-        
+        int i;        
         serEng>>i;
         fPSVIScope = (PSVIDefs::PSVIScope)i;
 
         serEng>>fAttName;
 
-        fDatatypeValidator    = DatatypeValidator::loadDV(serEng);
-        fAnyDatatypeValidator = DatatypeValidator::loadDV(serEng);
-        fMemberTypeValidator  = DatatypeValidator::loadDV(serEng);
+        fDatatypeValidator    = DatatypeValidator::loadDV(serEng);               
 
         /***
          * Deserialize ValueVectorOf<unsigned int>

Modified: xerces/c/trunk/src/xercesc/validators/schema/SchemaAttDef.hpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/validators/schema/SchemaAttDef.hpp?rev=231456&r1=231455&r2=231456&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/validators/schema/SchemaAttDef.hpp (original)
+++ xerces/c/trunk/src/xercesc/validators/schema/SchemaAttDef.hpp Thu Aug 11 06:53:15 2005
@@ -76,97 +76,6 @@
     virtual const XMLCh* getFullName() const;
     virtual void reset();
 
-
-    // ----------------------------------------------------------------------
-    // Partial implementation of PSVI
-    // The values these methods return are only accurate until the DOMAttr
-    // is created that uses the values. After this a clean up method is called
-    // and the SchemaAttDef may be used again.
-    // note that some of this information has dependancies. For example,
-    // if something is not valid then the information returned by the other 
-    // calls may be meaningless
-    // See http://www.w3.org/TR/xmlschema-1/ for detailed information
-    // ----------------------------------------------------------------------
-
-    /** 
-     * The appropriate case among the following:
-     * 1 If it was strictly assessed, then the appropriate case among the following:
-     * 1.1 If it was valid as defined by Attribute Locally Valid (3.2.4), then valid;
-     * 1.2 otherwise invalid.
-     * 2 otherwise notKnown.
-     * @deprecated
-     */
-    PSVIDefs::Validity getValidity() const;
-
-    /**
-     * The appropriate case among the following:
-     * 1 If it was strictly assessed, then full;
-     * 2 otherwise none.
-     * @deprecated
-     */
-    PSVIDefs::Validation getValidationAttempted() const;
-
-    /**
-     * @return the complexity. Always simple for attrs
-     * @deprecated
-     */
-    PSVIDefs::Complexity getTypeType() const;
-
-    /**
-     * The target namespace of the type definition.
-     * @deprecated
-     */
-    const XMLCh* getTypeUri() const;
-
-    /**
-     * The {name} of the type definition, if it is not absent. 
-     * @deprecated
-     */
-    const XMLCh* getTypeName() const;
-
-    /**
-     * true if the {name} of the type definition is absent, otherwise false.
-     * @deprecated
-     */
-    bool getTypeAnonymous() const;
-
-    /**
-     * If this method returns true and validity is VALID then the next three 
-     * produce accurate results
-     * @return true if the element is validated using a union type
-     * @deprecated
-     */
-    bool isTypeDefinitionUnion() const;
-
-    /**
-     * The {target namespace} of the actual member type definition.
-     * @deprecated
-     */
-    const XMLCh* getMemberTypeUri() const;
-
-    /**
-     * @return true if the {name} of the actual member type definition is absent, otherwise false.
-     * @deprecated
-     */
-    bool getMemberTypeAnonymous() const;
-
-    /**
-     * @return the {name} of the actual member type definition, if it is not absent. 
-     * @deprecated
-     */
-    const XMLCh* getMemberTypeName() const;
-
-    /*
-     * @deprecated
-     */
-    virtual const XMLCh* getDOMTypeInfoUri() const;
-    /*
-     * @deprecated
-     */
-    virtual const XMLCh* getDOMTypeInfoName() const;
-    
-    
-
     // -----------------------------------------------------------------------
     //  Getter methods
     // -----------------------------------------------------------------------
@@ -193,28 +102,12 @@
        ,const XMLCh* const        localPart
        ,const int                 uriId = -1
     );
-    void setDatatypeValidator(DatatypeValidator* newDatatypeValidator);
-    /*
-     * @deprecated
-     */
-    void setAnyDatatypeValidator(DatatypeValidator* newDatatypeValidator);
+    void setDatatypeValidator(DatatypeValidator* newDatatypeValidator);    
     void setBaseAttDecl(SchemaAttDef* const attDef);
     void setPSVIScope(const PSVIDefs::PSVIScope toSet);
-
-    /*
-     * @deprecated
-     */
-    void setMembertypeValidator(const DatatypeValidator* newDatatypeValidator);
+    
     void setNamespaceList(const ValueVectorOf<unsigned int>* const toSet);
     void resetNamespaceList();
-    /*
-     * @deprecated
-     */
-    void setValidity(PSVIDefs::Validity valid);
-    /*
-     * @deprecated
-     */
-    void setValidationAttempted(PSVIDefs::Validation validation);
     void setEnclosingCT(ComplexTypeInfo* complexTypeInfo);
     /***
      * Support for Serialization/De-serialization
@@ -241,24 +134,11 @@
     //      This is the name of the attribute.
     //
     //  fDatatypeValidator
-    //      The DatatypeValidator used to validate this attribute type.
-    //
-    //  fAnyDatatypeValidator
-    //      Tempory storage for the DatatypeValidator used to validate an any
-    //
-    //  fMemberTypeValidator
-    //      Tempory storage used when the validator being used is of union type.
-    //      This stores the actual member validator used to validate.
-    //
+    //      The DatatypeValidator used to validate this attribute type.        
+    //    
     //  fNamespaceList
     //      The list of namespace values for a wildcard attribute
-    //
-    //  fValidity
-    //      After this attr has been validated this is its validity
-    //
-    //  fValidation
-    //      The type of validation that happened to this attr
-    //
+    //    
     //  fBaseAttDecl
     //      The base attribute declaration that this attribute is based on
     //      NOTE: we do not have a notion of attribute use, so in the case
@@ -269,14 +149,10 @@
     // -----------------------------------------------------------------------
     unsigned int                 fElemId;
 
-    PSVIDefs::Validity           fValidity;
-    PSVIDefs::Validation         fValidation;
     PSVIDefs::PSVIScope          fPSVIScope;
 
     QName*                       fAttName;
-    DatatypeValidator*           fDatatypeValidator;
-    DatatypeValidator*           fAnyDatatypeValidator;
-    const DatatypeValidator*     fMemberTypeValidator;
+    DatatypeValidator*           fDatatypeValidator;    
     ValueVectorOf<unsigned int>* fNamespaceList;
     SchemaAttDef*                fBaseAttDecl;
 };
@@ -301,111 +177,6 @@
     return fDatatypeValidator;
 }
 
-inline void SchemaAttDef::setValidity(PSVIDefs::Validity valid) {
-    fValidity = valid;
-}
-
-inline void SchemaAttDef::setValidationAttempted(PSVIDefs::Validation validation) {
-    fValidation = validation;
-}
-
-
-inline const XMLCh* SchemaAttDef::getTypeName() const {
-    if(fAnyDatatypeValidator) 
-        return fAnyDatatypeValidator->getTypeLocalName();
-    else if(fDatatypeValidator)
-        return fDatatypeValidator->getTypeLocalName();
-
-    //its anySimpleType if we have not done validation on it
-    if(getValidationAttempted() == PSVIDefs::NONE)
-        return SchemaSymbols::fgDT_ANYSIMPLETYPE;
-
-
-    return 0;
-}
-
-inline PSVIDefs::Complexity SchemaAttDef::getTypeType() const {
-    return PSVIDefs::SIMPLE;
-}
-
-inline const XMLCh* SchemaAttDef::getTypeUri() const {
-    if(fAnyDatatypeValidator) 
-        return fAnyDatatypeValidator->getTypeUri();
-    else if(fDatatypeValidator) 
-        return fDatatypeValidator->getTypeUri();
-
-    //its anySimpleType if we have not done validation on it
-    if(getValidationAttempted() == PSVIDefs::NONE)
-        return SchemaSymbols::fgURI_SCHEMAFORSCHEMA;
-
-    return 0;
-}
-
-
-inline const XMLCh* SchemaAttDef::getMemberTypeName() const {
-    if(fMemberTypeValidator) 
-        return fMemberTypeValidator->getTypeLocalName();
-    return 0;
-}
-
-inline const XMLCh* SchemaAttDef::getMemberTypeUri() const {
-    if(fMemberTypeValidator) 
-        return fMemberTypeValidator->getTypeUri();
-    return 0;
-}
-
-inline PSVIDefs::Validity SchemaAttDef::getValidity() const {
-    return fValidity;
-}
-
-inline PSVIDefs::Validation SchemaAttDef::getValidationAttempted() const {
-    return fValidation;
-}
-
-inline const XMLCh* SchemaAttDef::getDOMTypeInfoName() const {
-    if(fValidity != PSVIDefs::VALID)
-        return SchemaSymbols::fgDT_ANYSIMPLETYPE;
-    if(getTypeAnonymous() || getMemberTypeAnonymous())
-        return 0;
-    if(fMemberTypeValidator)
-        return getMemberTypeName();
-
-    return getTypeName();
-}
-
-inline const XMLCh* SchemaAttDef::getDOMTypeInfoUri() const {
-    if(fValidity != PSVIDefs::VALID)
-        return SchemaSymbols::fgURI_SCHEMAFORSCHEMA;
-    if(getTypeAnonymous() || getMemberTypeAnonymous())
-        return 0;
-    if(fMemberTypeValidator)
-        return getMemberTypeUri();
-    return getTypeUri();
-}
-
-inline bool SchemaAttDef::getTypeAnonymous() const {
-    if(fAnyDatatypeValidator) 
-        return fAnyDatatypeValidator->getAnonymous();
-    else if(fDatatypeValidator)
-        return fDatatypeValidator->getAnonymous();
-
-    return false;
-}
-
-inline bool SchemaAttDef::getMemberTypeAnonymous() const {
-    if(fMemberTypeValidator) 
-        return fMemberTypeValidator->getAnonymous();
-
-    return false;
-}
-
-inline bool SchemaAttDef::isTypeDefinitionUnion() const {
-   if(fAnyDatatypeValidator && fAnyDatatypeValidator->getType() == DatatypeValidator::Union ||
-      fDatatypeValidator && fDatatypeValidator->getType() == DatatypeValidator::Union)
-       return true;
-    return false;
-}
-
 inline ValueVectorOf<unsigned int>*
 SchemaAttDef::getNamespaceList() const {
     return fNamespaceList;
@@ -444,16 +215,6 @@
     fDatatypeValidator = newDatatypeValidator;
 }
 
-inline void SchemaAttDef::setAnyDatatypeValidator(DatatypeValidator* newDatatypeValidator)
-{
-    fAnyDatatypeValidator = newDatatypeValidator;
-}
-
-inline void SchemaAttDef::setMembertypeValidator(const DatatypeValidator* newDatatypeValidator)
-{
-    fMemberTypeValidator = newDatatypeValidator;
-}
-
 inline void SchemaAttDef::resetNamespaceList() {
 
     if (fNamespaceList && fNamespaceList->size()) {
@@ -477,15 +238,7 @@
     }
 }
 
-inline void SchemaAttDef::reset() {
-    if(fAnyDatatypeValidator && fAnyDatatypeValidator->getType() == DatatypeValidator::Union)
-        ((UnionDatatypeValidator *)fAnyDatatypeValidator)->reset();
-    else if(fDatatypeValidator && fDatatypeValidator->getType() == DatatypeValidator::Union)
-        ((UnionDatatypeValidator *)fDatatypeValidator)->reset();
-    fAnyDatatypeValidator = 0;
-    fMemberTypeValidator = 0;
-    fValidity = PSVIDefs::UNKNOWN;
-    fValidation = PSVIDefs::NONE;    
+inline void SchemaAttDef::reset() {    
 }
 
 inline void SchemaAttDef::setEnclosingCT(ComplexTypeInfo*)

Modified: xerces/c/trunk/src/xercesc/validators/schema/SchemaElementDecl.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/validators/schema/SchemaElementDecl.cpp?rev=231456&r1=231455&r2=231456&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/validators/schema/SchemaElementDecl.cpp (original)
+++ xerces/c/trunk/src/xercesc/validators/schema/SchemaElementDecl.cpp Thu Aug 11 06:53:15 2005
@@ -40,24 +40,17 @@
     XMLElementDecl(manager)
     , fModelType(Any)
     , fPSVIScope(PSVIDefs::SCP_ABSENT)
-    , fValidity(PSVIDefs::UNKNOWN)
-    , fValidation(PSVIDefs::NONE)
     , fEnclosingScope(Grammar::TOP_LEVEL_SCOPE)
     , fFinalSet(0)
     , fBlockSet(0)    
     , fMiscFlags(0)
     , fDefaultValue(0)
     , fComplexTypeInfo(0)
-    , fAttDefs(0)
-    , fXsiComplexTypeInfo(0)
-    , fXsiSimpleTypeInfo(0)    
+    , fAttDefs(0)        
     , fIdentityConstraints(0)
     , fAttWildCard(0)
     , fSubstitutionGroupElem(0)
-    , fDatatypeValidator(0)
-    , fSeenValidation(false)
-    , fSeenNoValidation(false)
-    , fHadContent(false)
+    , fDatatypeValidator(0)    
 {
 }
 
@@ -70,24 +63,17 @@
     XMLElementDecl(manager)
     , fModelType(type)
     , fPSVIScope(PSVIDefs::SCP_ABSENT)
-    , fValidity(PSVIDefs::UNKNOWN)
-    , fValidation(PSVIDefs::NONE)
     , fEnclosingScope(enclosingScope)
     , fFinalSet(0)
     , fBlockSet(0)    
     , fMiscFlags(0)
     , fDefaultValue(0)
     , fComplexTypeInfo(0)
-    , fAttDefs(0)
-    , fXsiComplexTypeInfo(0)
-    , fXsiSimpleTypeInfo(0)    
+    , fAttDefs(0)          
     , fIdentityConstraints(0)
     , fAttWildCard(0)
     , fSubstitutionGroupElem(0)
     , fDatatypeValidator(0)
-    , fSeenValidation(false)
-    , fSeenNoValidation(false)
-    , fHadContent(false)
 {
     setElementName(prefix, localPart, uriId);
 }
@@ -99,24 +85,17 @@
     XMLElementDecl(manager)
     , fModelType(type)
     , fPSVIScope(PSVIDefs::SCP_ABSENT)
-    , fValidity(PSVIDefs::UNKNOWN)
-    , fValidation(PSVIDefs::NONE)
     , fEnclosingScope(enclosingScope)
     , fFinalSet(0)
     , fBlockSet(0)    
     , fMiscFlags(0)
     , fDefaultValue(0)
     , fComplexTypeInfo(0)
-    , fAttDefs(0)
-    , fXsiComplexTypeInfo(0)
-    , fXsiSimpleTypeInfo(0)    
+    , fAttDefs(0)        
     , fIdentityConstraints(0)
     , fAttWildCard(0)
     , fSubstitutionGroupElem(0)
     , fDatatypeValidator(0)
-    , fSeenValidation(false)
-    , fSeenNoValidation(false)
-    , fHadContent(false)
 {
     setElementName(elementName);
 }
@@ -300,9 +279,7 @@
     if (serEng.isStoring())
     {
         serEng<<(int)fModelType;
-        serEng<<(int)fPSVIScope;
-        serEng<<(int)fValidity;
-        serEng<<(int)fValidation;
+        serEng<<(int)fPSVIScope;        
 
         serEng<<fEnclosingScope;
         serEng<<fFinalSet;
@@ -317,12 +294,8 @@
          * Serialize RefHash2KeysTableOf<SchemaAttDef>* fAttDefs;
          ***/
 
-        XTemplateSerializer::storeObject(fAttDefs, serEng);
-
-        serEng<<fXsiComplexTypeInfo;
-
-        DatatypeValidator::storeDV(serEng, (DatatypeValidator*)fXsiSimpleTypeInfo);
-
+        XTemplateSerializer::storeObject(fAttDefs, serEng);        
+        
         /***
          * Serialize RefVectorOf<IdentityConstraint>*   fIdentityConstraints;
          ***/
@@ -330,12 +303,7 @@
 
         serEng<<fAttWildCard;
         serEng<<fSubstitutionGroupElem;
-        DatatypeValidator::storeDV(serEng, fDatatypeValidator);
-
-        serEng<<fSeenValidation;
-        serEng<<fSeenNoValidation;
-        serEng<<fHadContent;
-            
+        DatatypeValidator::storeDV(serEng, fDatatypeValidator);                
     }
     else
     {
@@ -343,11 +311,7 @@
         serEng>>i;
         fModelType = (ModelTypes)i;
         serEng>>i;
-        fPSVIScope = (PSVIDefs::PSVIScope)i;
-        serEng>>i;
-        fValidity = (PSVIDefs::Validity)i;
-        serEng>> i;
-        fValidation = (PSVIDefs::Validation)i;
+        fPSVIScope = (PSVIDefs::PSVIScope)i;   
 
         serEng>>fEnclosingScope;
         serEng>>fFinalSet;
@@ -361,11 +325,7 @@
         /***
          * DeSerialize RefHash2KeysTableOf<SchemaAttDef>* fAttDefs;
          ***/
-        XTemplateSerializer::loadObject(&fAttDefs, 29, true, serEng);
-
-        serEng>>fXsiComplexTypeInfo;
-
-        fXsiSimpleTypeInfo = DatatypeValidator::loadDV(serEng);
+        XTemplateSerializer::loadObject(&fAttDefs, 29, true, serEng);                
 
         /***
          * DeSerialize RefVectorOf<IdentityConstraint>*   fIdentityConstraints;
@@ -375,13 +335,7 @@
         serEng>>fAttWildCard;
         serEng>>fSubstitutionGroupElem;
         fDatatypeValidator = DatatypeValidator::loadDV(serEng);
-
-        serEng>>fSeenValidation;
-        serEng>>fSeenNoValidation;
-        serEng>>fHadContent;
-
     }
-
 }
 
 XMLElementDecl::objectType  SchemaElementDecl::getObjectType() const

Modified: xerces/c/trunk/src/xercesc/validators/schema/SchemaElementDecl.hpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/validators/schema/SchemaElementDecl.hpp?rev=231456&r1=231455&r2=231456&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/validators/schema/SchemaElementDecl.hpp (original)
+++ xerces/c/trunk/src/xercesc/validators/schema/SchemaElementDecl.hpp Thu Aug 11 06:53:15 2005
@@ -27,7 +27,6 @@
 #include <xercesc/validators/schema/ComplexTypeInfo.hpp>
 #include <xercesc/validators/schema/identity/IdentityConstraint.hpp>
 #include <xercesc/validators/datatype/DatatypeValidator.hpp>
-#include <xercesc/validators/datatype/UnionDatatypeValidator.hpp>
 #include <xercesc/validators/schema/PSVIDefs.hpp>
 
 XERCES_CPP_NAMESPACE_BEGIN
@@ -131,106 +130,6 @@
     virtual bool isGlobalDecl() const;
     SchemaElementDecl* getSubstitutionGroupElem() const;
 
-
-    // ----------------------------------------------------------------------
-    // Partial implementation of PSVI
-    // The values these methods return are only accurate until the cleanUp method
-    // is called (in the end tag part of the scanner you are using)
-    // note that some of this information has dependancies. For example,
-    // if something is not valid then the information returned by the other 
-    // calls may be meaningless
-    // See http://www.w3.org/TR/xmlschema-1/ for detailed information
-    // ----------------------------------------------------------------------
-
-
-    /**
-     * The appropriate case among the following:
-     * 1 If it was strictly assessed, then the appropriate case among the following:
-     * 1.1 If all of the following are true
-     *    1.1.1
-     *    1.1.1.1 clause 1.1 of Schema-Validity Assessment (Element) (3.3.4) applied and the item was valid as defined by Element Locally Valid (Element) (3.3.4);
-     *    1.1.1.2 clause 1.2 of Schema-Validity Assessment (Element) (3.3.4) applied and the item was valid as defined by Element Locally Valid (Type) (3.3.4).
-     *    1.1.2 Neither its [children] nor its [attributes] contains an information item (element or attribute respectively) whose [validity] is invalid.
-     *    1.1.3 Neither its [children] nor its [attributes] contains an information item (element or attribute respectively) with a context-determined declaration of mustFind whose [validity] is unknown.
-     * , then valid;
-     *    1.2 otherwise invalid.
-     *    2 otherwise notKnown.
-     * @deprecated; not thread-safe
-     */
-    PSVIDefs::Validity getValidity() const;
-
-
-    /**
-     * The appropriate case among the following:
-     * 1 If it was strictly assessed and neither its [children] nor its [attributes] contains an information item (element or attribute respectively) whose [validation attempted] is not full, then full;
-     * 2 If it was not strictly assessed and neither its [children] nor its [attributes] contains an information item (element or attribute respectively) whose [validation attempted] is not none, then none;
-     *3 otherwise partial.
-     * @deprecated; not thread-safe
-     */
-    PSVIDefs::Validation getValidationAttempted() const;
-
-
-    /**
-     * @return the complexity. simple or complex, depending on the type definition.
-     * @deprecated; not thread-safe
-     */
-    PSVIDefs::Complexity getTypeType() const;
-
-    /**
-     * The target namespace of the type definition.
-     * @deprecated; not thread-safe (will not work with xsi:type and shared grammars)
-     */
-    const XMLCh* getTypeUri() const;
-
-    /**
-     * The {name} of the type definition, if it is not absent. 
-     * @deprecated; not thread-safe (will not work with xsi:type and shared grammars)
-     */
-    const XMLCh* getTypeName() const;
-
-    /**
-     * true if the {name} of the type definition is absent, otherwise false.
-     * @deprecated; not thread-safe (will not work with xsi:type and shared grammars)
-     */
-    bool getTypeAnonymous() const;
-
-    /**
-     * If this method returns true and validity is VALID then the next three 
-     * produce accurate results
-     * @return true if the element is validated using a union type
-     * @deprecated; not thread-safe (will not work with xsi:type and shared grammars)
-     */
-    bool isTypeDefinitionUnion() const;
-
-    /**
-     * The {target namespace} of the actual member type definition.
-     * @deprecated; not thread-safe (will not work with xsi:type and shared grammars)
-     */
-    const XMLCh* getMemberTypeUri() const;
-
-    /**
-     * @return true if the {name} of the actual member type definition is absent, otherwise false.
-     * @deprecated; not thread-safe (will not work with xsi:type and shared grammars)
-     */
-    bool getMemberTypeAnonymous() const;
-
-    /**
-     * @return the {name} of the actual member type definition, if it is not absent. 
-     * @deprecated; not thread-safe (will not work with xsi:type and shared grammars)
-     */
-    const XMLCh* getMemberTypeName() const;
-
-
-    /**
-     * @deprecated; not thread-safe (will not work with xsi:type and shared grammars)
-     */
-    virtual const XMLCh* getDOMTypeInfoUri() const;
-    /**
-     * @deprecated; not thread-safe (will not work with xsi:type and shared grammars)
-     */
-    virtual const XMLCh* getDOMTypeInfoName() const;
-
-
     // -----------------------------------------------------------------------
     //  Setter methods
     // -----------------------------------------------------------------------
@@ -246,41 +145,9 @@
     void setBlockSet(const int blockSet);
     void setMiscFlags(const int flags);
     void setDefaultValue(const XMLCh* const value);
-    void setComplexTypeInfo(ComplexTypeInfo* const typeInfo);
-    /**
-     * @deprecated; not thread-safe (will not work with xsi:type and shared grammars)
-     */
-    void setXsiComplexTypeInfo(ComplexTypeInfo* const typeInfo);
-    /**
-     * @deprecated; not thread-safe (will not work with xsi:type and shared grammars)
-     */
-    void setXsiSimpleTypeInfo(const DatatypeValidator* const dtv);
+    void setComplexTypeInfo(ComplexTypeInfo* const typeInfo);	
     void setAttWildCard(SchemaAttDef* const attWildCard);
-    void setSubstitutionGroupElem(SchemaElementDecl* const elemDecl);
-    /**
-     * @deprecated; not thread-safe (will not work with xsi:type and shared grammars)
-     */
-    void setValidity(PSVIDefs::Validity valid);
-    /**
-     * @deprecated; not thread-safe (will not work with xsi:type and shared grammars)
-     */
-    void setValidationAttempted(PSVIDefs::Validation validation);
-    
-    /**
-     * called when element content of this element was validated
-     * @deprecated; not thread-safe (will not work with xsi:type and shared grammars)
-     */
-    void updateValidityFromElement(const XMLElementDecl *decl, Grammar::GrammarType eleGrammar);
-    
-    //called when attribute content of this element was validated    
-    // @deprecated; should not be needed in a thread-safe implementation
-    void updateValidityFromAttribute(const SchemaAttDef *def);
-
-    /**
-     * cleans up inbetween uses of the SchemaElementDecl. Resets xsiType, Validity etc.
-     * @deprecated; not thread-safe (will not work with xsi:type and shared grammars)
-     */
-    void reset();
+    void setSubstitutionGroupElem(SchemaElementDecl* const elemDecl);  
 
     // -----------------------------------------------------------------------
     //  IC methods
@@ -336,16 +203,8 @@
     //      The list of attributes that are faulted in for this element
     //      when ComplexTypeInfo does not exist.  We want to keep track
     //      of these faulted in attributes to avoid duplicate redundant
-    //      error.
-    //
-    //  fXsiComplexTypeInfo
-    //      Temporary store the xsi:type ComplexType here for validation
-    //      If it presents, then it takes precedence than its own fComplexTypeInfo.
-    //
-    //  fXsiSimpleTypeInfo
-    //      Temporary store the xsi:type SimpleType here for validation
-    //      If it present then the information from it will be returned rather than fDatatypeValidator
-    //
+    //      error.      
+    //    	
     //  fIdentityConstraints
     //      Store information about an element identity constraints.
     //
@@ -354,29 +213,12 @@
     //      'anyType'.
     //
     //  fSubstitutionGroupElem
-    //      The substitution group element declaration.
-    //
-    //  fValidity
-    //      After this attr has been validated this is its validity
-    //
-    //  fValidation
-    //      The type of validation that happened to this attr
-    //
-    //  fSeenValidation
-    //      set to true when a piece of content of this element is validated 
-    //
-    //  fSeenNoValidation
-    //      set to true when a piece of content of this element is laxly or skip validated
-    //
-    //  fHadContent
-    //      true when this element actually had content.
+    //      The substitution group element declaration.   
     // -----------------------------------------------------------------------
 
     // -----------------------------------------------------------------------
     ModelTypes                         fModelType;
     PSVIDefs::PSVIScope                fPSVIScope;
-    PSVIDefs::Validity                 fValidity;
-    PSVIDefs::Validation               fValidation;
 
     int                                fEnclosingScope;
     int                                fFinalSet;
@@ -384,17 +226,11 @@
     int                                fMiscFlags;    
     XMLCh*                             fDefaultValue;
     ComplexTypeInfo*                   fComplexTypeInfo;
-    RefHash2KeysTableOf<SchemaAttDef>* fAttDefs;
-    ComplexTypeInfo*                   fXsiComplexTypeInfo;
-    const DatatypeValidator*           fXsiSimpleTypeInfo;
+    RefHash2KeysTableOf<SchemaAttDef>* fAttDefs;        	
     RefVectorOf<IdentityConstraint>*   fIdentityConstraints;
     SchemaAttDef*                      fAttWildCard;
     SchemaElementDecl*                 fSubstitutionGroupElem;
-    DatatypeValidator*                 fDatatypeValidator;
-
-    bool                               fSeenValidation;
-    bool                               fSeenNoValidation;
-    bool                               fHadContent;
+    DatatypeValidator*                 fDatatypeValidator; 
 };
 
 // ---------------------------------------------------------------------------
@@ -458,7 +294,6 @@
 
 inline DatatypeValidator* SchemaElementDecl::getDatatypeValidator() const
 {
-
     return fDatatypeValidator;
 }
 
@@ -489,17 +324,14 @@
 
 inline ComplexTypeInfo* SchemaElementDecl::getComplexTypeInfo() const
 {
-
     return fComplexTypeInfo;
 }
 
 inline const SchemaAttDef* SchemaElementDecl::getAttWildCard() const {
-
     return fAttWildCard;
 }
 
 inline SchemaAttDef* SchemaElementDecl::getAttWildCard() {
-
     return fAttWildCard;
 }
 
@@ -514,164 +346,6 @@
     return fSubstitutionGroupElem;
 }
 
-inline const XMLCh* SchemaElementDecl::getTypeName() const {
-    // removing fXsi* references would break DOMTypeInfo implementation completely;
-    // will have to wait for now
-    if (fXsiComplexTypeInfo)
-        return fXsiComplexTypeInfo->getTypeLocalName();
-    else if (fComplexTypeInfo) 
-        return fComplexTypeInfo->getTypeLocalName();
-    else if(fXsiSimpleTypeInfo)
-        return fXsiSimpleTypeInfo->getTypeLocalName();
-    else if(fDatatypeValidator)
-        return fDatatypeValidator->getTypeLocalName();
-
-    //its anyType if we have not done validation on it or none of the above exist
-    return SchemaSymbols::fgATTVAL_ANYTYPE;
-}
-
-inline PSVIDefs::Complexity SchemaElementDecl::getTypeType() const {
-    if(getModelType() == Simple) {
-        return PSVIDefs::SIMPLE;
-    }
-    else {
-        return PSVIDefs::COMPLEX;
-    }
-}
-
-
-inline const XMLCh* SchemaElementDecl::getTypeUri() const {
-    // removing fXsi* references would break DOMTypeInfo implementation completely;
-    // will have to wait for now
-    if (fXsiComplexTypeInfo)
-        return fXsiComplexTypeInfo->getTypeUri();
-    else if (fComplexTypeInfo)
-        return fComplexTypeInfo->getTypeUri();
-    else if(fXsiSimpleTypeInfo)
-        return fXsiSimpleTypeInfo->getTypeUri();
-    else if(fDatatypeValidator)
-        return fDatatypeValidator->getTypeUri();
-
-    //its anyType if we have not done validation on it or none of the above exist
-    return SchemaSymbols::fgURI_SCHEMAFORSCHEMA;
-}
-
-inline const XMLCh* SchemaElementDecl::getMemberTypeName() const {
-    // removing fXsi* references would break DOMTypeInfo implementation completely;
-    // will have to wait for now
-    if(fXsiSimpleTypeInfo && fXsiSimpleTypeInfo->getType() == DatatypeValidator::Union)
-        return ((UnionDatatypeValidator*)fXsiSimpleTypeInfo)->getMemberTypeName();
-    else if(fDatatypeValidator && fDatatypeValidator->getType() == DatatypeValidator::Union)
-        return ((UnionDatatypeValidator*)fDatatypeValidator)->getMemberTypeName();
-    return 0;
-}
-
-inline const XMLCh* SchemaElementDecl::getMemberTypeUri() const {
-    // removing fXsi* references would break DOMTypeInfo implementation completely;
-    // will have to wait for now
-    if(fXsiSimpleTypeInfo && fXsiSimpleTypeInfo->getType() == DatatypeValidator::Union)
-        return ((UnionDatatypeValidator*)fXsiSimpleTypeInfo)->getMemberTypeUri();
-    if(fDatatypeValidator && fDatatypeValidator->getType() == DatatypeValidator::Union)
-        return ((UnionDatatypeValidator*)fDatatypeValidator)->getMemberTypeUri();
-
-    return 0;
-}
-
-inline bool SchemaElementDecl::getMemberTypeAnonymous() const {
-    // removing fXsi* references would break DOMTypeInfo implementation completely;
-    // will have to wait for now
-    if(fXsiSimpleTypeInfo && fXsiSimpleTypeInfo->getType() == DatatypeValidator::Union)
-        return ((UnionDatatypeValidator*)fXsiSimpleTypeInfo)->getMemberTypeAnonymous();
-    else if(fDatatypeValidator && fDatatypeValidator->getType() == DatatypeValidator::Union)
-        return ((UnionDatatypeValidator*)fDatatypeValidator)->getMemberTypeAnonymous();
-    return false;
-}
-
-inline bool SchemaElementDecl::isTypeDefinitionUnion() const {
-    // removing fXsi* references would break DOMTypeInfo implementation completely;
-    // will have to wait for now
-   if(fXsiSimpleTypeInfo && fXsiSimpleTypeInfo->getType() == DatatypeValidator::Union ||
-      fDatatypeValidator && fDatatypeValidator->getType() == DatatypeValidator::Union)
-       return true;
-    return false;
-}
-
-inline PSVIDefs::Validity SchemaElementDecl::getValidity() const {
-    return fValidity;
-}
-
-inline PSVIDefs::Validation SchemaElementDecl::getValidationAttempted() const {
-    if(!fHadContent)
-        return fValidation;
-
-    if(!fSeenNoValidation && fSeenValidation)
-        return PSVIDefs::FULL;
-    else if(fSeenNoValidation && !fSeenValidation)
-        return PSVIDefs::NONE;
-    else
-        return PSVIDefs::PARTIAL;
-}
-
-inline bool SchemaElementDecl::getTypeAnonymous() const {
-    
-    //REVISIT - since xsi type have to be accessed through names 
-    //presumeably they cannot be anonymous
-    
-    if (fXsiComplexTypeInfo) {
-        return fXsiComplexTypeInfo->getAnonymous();
-    }
-    else if (fComplexTypeInfo) {
-        return fComplexTypeInfo->getAnonymous();
-    }
-    else if(fXsiSimpleTypeInfo) {
-        return fXsiSimpleTypeInfo->getAnonymous();
-    }
-    else if(fDatatypeValidator){
-        return fDatatypeValidator->getAnonymous();
-    }
-
-    return false;
-}
-
-inline const XMLCh* SchemaElementDecl::getDOMTypeInfoName() const {
-    // removing fXsi* references would break DOMTypeInfo implementation completely;
-    // will have to wait for now
-    if(fValidity != PSVIDefs::VALID) {
-        if(getTypeType() == PSVIDefs::SIMPLE)
-            return SchemaSymbols::fgDT_ANYSIMPLETYPE;
-        else
-            return SchemaSymbols::fgATTVAL_ANYTYPE;
-    }
-
-    if(getTypeAnonymous() || getMemberTypeAnonymous())
-        return 0;
-    if(fDatatypeValidator && fDatatypeValidator->getType() == DatatypeValidator::Union)
-        return ((UnionDatatypeValidator*)fDatatypeValidator)->getMemberTypeName();
-    if(fXsiSimpleTypeInfo && fXsiSimpleTypeInfo->getType() == DatatypeValidator::Union)
-        return ((UnionDatatypeValidator*)fXsiSimpleTypeInfo)->getMemberTypeName();
-    return getTypeName();
-}
-
-inline const XMLCh* SchemaElementDecl::getDOMTypeInfoUri() const {
-
-    // removing fXsi* references would break DOMTypeInfo implementation completely;
-    // will have to wait for now
-    if(fValidity != PSVIDefs::VALID)
-        return SchemaSymbols::fgURI_SCHEMAFORSCHEMA;
-
-    if(getTypeAnonymous() || getMemberTypeAnonymous())
-        return 0;
-
-    if(fDatatypeValidator && fDatatypeValidator->getType() == DatatypeValidator::Union)
-        return ((UnionDatatypeValidator*)fDatatypeValidator)->getMemberTypeUri();
-
-    if(fXsiSimpleTypeInfo && fXsiSimpleTypeInfo->getType() == DatatypeValidator::Union)
-        return ((UnionDatatypeValidator*)fXsiSimpleTypeInfo)->getMemberTypeUri();
-
-
-    return getTypeUri();
-}
-
 // ---------------------------------------------------------------------------
 //  SchemaElementDecl: Setter methods
 // ---------------------------------------------------------------------------
@@ -735,18 +409,6 @@
 }
 
 inline void
-SchemaElementDecl::setXsiComplexTypeInfo(ComplexTypeInfo* const typeInfo)
-{
-    fXsiComplexTypeInfo = typeInfo;
-}
-
-inline void
-SchemaElementDecl::setXsiSimpleTypeInfo(const DatatypeValidator* const dtv)
-{
-    fXsiSimpleTypeInfo = dtv;
-}
-
-inline void
 SchemaElementDecl::setAttWildCard(SchemaAttDef* const attWildCard) {
 
     if (fAttWildCard)
@@ -759,70 +421,6 @@
 SchemaElementDecl::setSubstitutionGroupElem(SchemaElementDecl* const elemDecl) {
 
     fSubstitutionGroupElem = elemDecl;
-}
-
-inline void SchemaElementDecl::setValidity(PSVIDefs::Validity valid) {
-    fValidity = valid;
-}
-
-inline void SchemaElementDecl::setValidationAttempted(PSVIDefs::Validation validation) {
-    fValidation = validation;
-}
-
-inline void SchemaElementDecl::updateValidityFromAttribute(const SchemaAttDef *def) {
-
-    PSVIDefs::Validation curValAttemted = def->getValidationAttempted();
-    PSVIDefs::Validity curVal = def->getValidity();
-        
-    if(curValAttemted == PSVIDefs::NONE || curValAttemted == PSVIDefs::PARTIAL) {
-        fSeenNoValidation = true;
-        fValidity = PSVIDefs::UNKNOWN;
-    }
-    else {
-        fSeenValidation = true;
-    }
-        
-    if(curVal == PSVIDefs::INVALID)
-        fValidity = PSVIDefs::INVALID;
-
-    fHadContent = true;
-}
-
-inline void SchemaElementDecl::updateValidityFromElement(const XMLElementDecl *decl, Grammar::GrammarType eleGrammar) {
-
-    if (eleGrammar == Grammar::SchemaGrammarType) {                    
-        PSVIDefs::Validation curValAttemted = ((SchemaElementDecl *)decl)->getValidationAttempted();
-        PSVIDefs::Validity curVal = ((SchemaElementDecl *)decl)->getValidity();
-        
-        if(curValAttemted == PSVIDefs::NONE || curValAttemted == PSVIDefs::PARTIAL) {
-            fSeenNoValidation = true;
-            fValidity = PSVIDefs::UNKNOWN;
-        }
-        else {
-            fSeenValidation = true;
-        }
-        
-        if(curVal == PSVIDefs::INVALID)
-            fValidity = PSVIDefs::INVALID;
-    }
-
-    fHadContent = true;
-
-}
-
-inline void SchemaElementDecl::reset() {
-    if(fXsiSimpleTypeInfo && fXsiSimpleTypeInfo->getType() == DatatypeValidator::Union)
-        ((UnionDatatypeValidator *)fXsiSimpleTypeInfo)->reset();
-    if(fDatatypeValidator && fDatatypeValidator->getType() == DatatypeValidator::Union)
-        ((UnionDatatypeValidator *)fDatatypeValidator)->reset();
-
-    setXsiSimpleTypeInfo(0);
-    setXsiComplexTypeInfo(0);
-    fValidity = PSVIDefs::UNKNOWN;
-    fValidation = PSVIDefs::NONE;    
-    fSeenValidation = false;
-    fSeenNoValidation = false;
-    fHadContent = false;
 }
 
 // ---------------------------------------------------------------------------



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