File indexing completed on 2025-12-16 10:34:31
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #if !defined(XERCESC_INCLUDE_GUARD_MIXEDCONTENTMODEL_HPP)
0023 #define XERCESC_INCLUDE_GUARD_MIXEDCONTENTMODEL_HPP
0024
0025 #include <xercesc/util/ValueVectorOf.hpp>
0026 #include <xercesc/framework/XMLContentModel.hpp>
0027 #include <xercesc/validators/common/ContentLeafNameTypeVector.hpp>
0028
0029 XERCES_CPP_NAMESPACE_BEGIN
0030
0031 class ContentSpecNode;
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046 class MixedContentModel : public XMLContentModel
0047 {
0048 public :
0049
0050
0051
0052 MixedContentModel
0053 (
0054 const bool dtd
0055 , ContentSpecNode* const parentContentSpec
0056 , const bool ordered = false
0057 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
0058 );
0059
0060 ~MixedContentModel();
0061
0062
0063
0064
0065
0066 bool hasDups() const;
0067
0068
0069
0070
0071 virtual bool validateContent
0072 (
0073 QName** const children
0074 , XMLSize_t childCount
0075 , unsigned int emptyNamespaceId
0076 , XMLSize_t* indexFailingChild
0077 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
0078 ) const;
0079
0080 virtual bool validateContentSpecial
0081 (
0082 QName** const children
0083 , XMLSize_t childCount
0084 , unsigned int emptyNamespaceId
0085 , GrammarResolver* const pGrammarResolver
0086 , XMLStringPool* const pStringPool
0087 , XMLSize_t* indexFailingChild
0088 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
0089 ) const;
0090
0091 virtual ContentLeafNameTypeVector* getContentLeafNameTypeVector() const ;
0092
0093 virtual unsigned int getNextState(unsigned int currentState,
0094 XMLSize_t elementIndex) const;
0095
0096 virtual bool handleRepetitions( const QName* const curElem,
0097 unsigned int curState,
0098 unsigned int currentLoop,
0099 unsigned int& nextState,
0100 unsigned int& nextLoop,
0101 XMLSize_t elementIndex,
0102 SubstitutionGroupComparator * comparator) const;
0103
0104 virtual void checkUniqueParticleAttribution
0105 (
0106 SchemaGrammar* const pGrammar
0107 , GrammarResolver* const pGrammarResolver
0108 , XMLStringPool* const pStringPool
0109 , XMLValidator* const pValidator
0110 , unsigned int* const pContentSpecOrgURI
0111 , const XMLCh* pComplexTypeName = 0
0112 ) ;
0113
0114 private :
0115
0116
0117
0118 void buildChildList
0119 (
0120 ContentSpecNode* const curNode
0121 , ValueVectorOf<QName*>& toFill
0122 , ValueVectorOf<ContentSpecNode::NodeTypes>& toType
0123 );
0124
0125
0126
0127
0128 MixedContentModel();
0129 MixedContentModel(const MixedContentModel&);
0130 MixedContentModel& operator=(const MixedContentModel&);
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144
0145
0146
0147
0148
0149
0150
0151
0152
0153
0154 XMLSize_t fCount;
0155 QName** fChildren;
0156 ContentSpecNode::NodeTypes* fChildTypes;
0157 bool fOrdered;
0158 bool fDTD;
0159 MemoryManager* fMemoryManager;
0160 };
0161
0162 inline ContentLeafNameTypeVector* MixedContentModel::getContentLeafNameTypeVector() const
0163 {
0164 return 0;
0165 }
0166
0167 inline unsigned int
0168 MixedContentModel::getNextState(unsigned int,
0169 XMLSize_t) const {
0170
0171 return XMLContentModel::gInvalidTrans;
0172 }
0173
0174 inline bool
0175 MixedContentModel::handleRepetitions( const QName* const ,
0176 unsigned int ,
0177 unsigned int ,
0178 unsigned int& ,
0179 unsigned int& ,
0180 XMLSize_t ,
0181 SubstitutionGroupComparator * ) const
0182 {
0183 return true;
0184 }
0185
0186 inline void MixedContentModel::checkUniqueParticleAttribution
0187 (
0188 SchemaGrammar* const
0189 , GrammarResolver* const
0190 , XMLStringPool* const
0191 , XMLValidator* const
0192 , unsigned int* const pContentSpecOrgURI
0193 , const XMLCh*
0194 )
0195 {
0196
0197 unsigned int i = 0;
0198 for (i = 0; i < fCount; i++) {
0199 unsigned int orgURIIndex = fChildren[i]->getURI();
0200 if ((orgURIIndex != XMLContentModel::gEOCFakeId) &&
0201 (orgURIIndex != XMLElementDecl::fgInvalidElemId) &&
0202 (orgURIIndex != XMLElementDecl::fgPCDataElemId))
0203 fChildren[i]->setURI(pContentSpecOrgURI[orgURIIndex]);
0204 }
0205
0206
0207
0208 }
0209
0210 XERCES_CPP_NAMESPACE_END
0211
0212 #endif