- Main Page
- Related Pages
- Classes
- Files

# XMLContentModel.hpp

Go to the documentation of this file.

    00001 /*
    00002  * Licensed to the Apache Software Foundation (ASF) under one or more
    00003  * contributor license agreements.  See the NOTICE file distributed with
    00004  * this work for additional information regarding copyright ownership.
    00005  * The ASF licenses this file to You under the Apache License, Version 2.0
    00006  * (the "License"); you may not use this file except in compliance with
    00007  * the License.  You may obtain a copy of the License at
    00008  *
    00009  *      http://www.apache.org/licenses/LICENSE-2.0
    00010  *
    00011  * Unless required by applicable law or agreed to in writing, software
    00012  * distributed under the License is distributed on an "AS IS" BASIS,
    00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    00014  * See the License for the specific language governing permissions and
    00015  * limitations under the License.
    00016  */
    00017
    00018 /*
    00019  * $Id: XMLContentModel.hpp 677705 2008-07-17 20:15:32Z amassari $
    00020  */
    00021
    00022 #if !defined(XERCESC_INCLUDE_GUARD_XMLCONTENTMODEL_HPP)
    00023 #define XERCESC_INCLUDE_GUARD_XMLCONTENTMODEL_HPP
    00024
    00025 #include <xercesc/util/XMemory.hpp>
    00026 #include <xercesc/util/QName.hpp>
    00027
    00028 XERCES_CPP_NAMESPACE_BEGIN
    00029
    00030 class ContentLeafNameTypeVector;
    00031 class GrammarResolver;
    00032 class XMLStringPool;
    00033 class XMLValidator;
    00034 class SchemaGrammar;
    00035 class SubstitutionGroupComparator;
    00036
    00046 class XMLPARSER_EXPORT XMLContentModel : public XMemory
    00047 {
    00048 public:
    00049     // ---------------------------------------------------------------------------
    00050     //  Public static data
    00051     //
    00052     //  gInvalidTrans
    00053     //      This value represents an invalid transition in each line of the
    00054     //      transition table.
    00055     //
    00056     //  gEOCFakeId
    00057     //  gEpsilonFakeId
    00058     //      We have to put in a couple of special CMLeaf nodes to represent
    00059     //      special values, using fake element ids that we know won't conflict
    00060     //      with real element ids.
    00061     //
    00062     //
    00063     // ---------------------------------------------------------------------------
    00064     static const unsigned int   gInvalidTrans;
    00065     static const unsigned int   gEOCFakeId;
    00066     static const unsigned int   gEpsilonFakeId;
    00067
    00068     // -----------------------------------------------------------------------
    00069     //  Constructors are hidden, only the virtual Destructor is exposed
    00070     // -----------------------------------------------------------------------
    00073     virtual ~XMLContentModel()
    00074     {
    00075     }
    00077
    00078
    00079     // -----------------------------------------------------------------------
    00080     //  The virtual content model interface provided by derived classes
    00081     // -----------------------------------------------------------------------
    00082     virtual bool validateContent
    00083     (
    00084         QName** const         children
    00085       , XMLSize_t             childCount
    00086       , unsigned int          emptyNamespaceId
    00087       , XMLSize_t*            indexFailingChild
    00088       , MemoryManager*  const manager = XMLPlatformUtils::fgMemoryManager
    00089     ) const = 0;
    00090
    00091     virtual bool validateContentSpecial
    00092     (
    00093         QName** const           children
    00094       , XMLSize_t               childCount
    00095       , unsigned int            emptyNamespaceId
    00096       , GrammarResolver*  const pGrammarResolver
    00097       , XMLStringPool*    const pStringPool
    00098       , XMLSize_t*              indexFailingChild
    00099       , MemoryManager*    const manager = XMLPlatformUtils::fgMemoryManager
    00100     ) const =0;
    00101
    00102     virtual void checkUniqueParticleAttribution
    00103     (
    00104         SchemaGrammar*    const pGrammar
    00105       , GrammarResolver*  const pGrammarResolver
    00106       , XMLStringPool*    const pStringPool
    00107       , XMLValidator*     const pValidator
    00108       , unsigned int*     const pContentSpecOrgURI
    00109       , const XMLCh*            pComplexTypeName = 0
    00110     ) =0;
    00111
    00112     virtual ContentLeafNameTypeVector* getContentLeafNameTypeVector()
    00113       const = 0;
    00114
    00115     virtual unsigned int getNextState(unsigned int currentState,
    00116                                       XMLSize_t    elementIndex) const = 0;
    00117
    00118     virtual bool handleRepetitions( const QName* const curElem,
    00119                                     unsigned int curState,
    00120                                     unsigned int currentLoop,
    00121                                     unsigned int& nextState,
    00122                                     unsigned int& nextLoop,
    00123                                     XMLSize_t elementIndex,
    00124                                     SubstitutionGroupComparator * comparator) const = 0;
    00125
    00126 protected :
    00127     // -----------------------------------------------------------------------
    00128     //  Hidden Constructors
    00129     // -----------------------------------------------------------------------
    00130     XMLContentModel()
    00131     {
    00132     }
    00133
    00134
    00135 private :
    00136     // -----------------------------------------------------------------------
    00137     //  Unimplemented constructors and operators
    00138     // -----------------------------------------------------------------------
    00139     XMLContentModel(const XMLContentModel&);
    00140     XMLContentModel& operator=(const XMLContentModel&);
    00141 };
    00142
    00143 XERCES_CPP_NAMESPACE_END
    00144
    00145 #endif