亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? allcontentmodel.cpp

?? IBM的解析xml的工具Xerces的源代碼
?? CPP
字號:
/* * Copyright 2001,2004 The Apache Software Foundation. *  * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at *  *      http://www.apache.org/licenses/LICENSE-2.0 *  * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *//* * $Log: AllContentModel.cpp,v $ * Revision 1.10  2004/09/16 13:32:03  amassari * Updated error message for UPA to also state the complex type that is failing the test * * Revision 1.9  2004/09/08 13:56:51  peiyongz * Apache License Version 2.0 * * Revision 1.8  2004/01/29 11:51:21  cargilld * Code cleanup changes to get rid of various compiler diagnostic messages. * * Revision 1.7  2003/12/17 00:18:38  cargilld * Update to memory management so that the static memory manager (one used to call Initialize) is only for static data. * * Revision 1.6  2003/11/20 18:09:18  knoaman * Store a copy of each child, instead of a reference, as the content spec node * tree is not guaranteed to be persistent. * * Revision 1.5  2003/05/18 14:02:06  knoaman * Memory manager implementation: pass per instance manager. * * Revision 1.4  2003/05/15 18:48:27  knoaman * Partial implementation of the configurable memory manager. * * Revision 1.3  2002/11/04 14:54:58  tng * C++ Namespace Support. * * Revision 1.2  2002/09/24 19:48:39  tng * Performance: use XMLString::equals instead of XMLString::compareString * * Revision 1.1.1.1  2002/02/01 22:22:37  peiyongz * sane_include * * Revision 1.3  2001/11/21 14:30:13  knoaman * Fix for UPA checking. * * Revision 1.2  2001/08/27 12:19:00  tng * Schema: AllContentModel UPA Check typo fix * * Revision 1.1  2001/08/24 12:48:48  tng * Schema: AllContentModel * */// ---------------------------------------------------------------------------//  Includes// ---------------------------------------------------------------------------#include <xercesc/util/RuntimeException.hpp>#include <xercesc/framework/XMLElementDecl.hpp>#include <xercesc/framework/XMLValidator.hpp>#include <xercesc/validators/common/ContentSpecNode.hpp>#include <xercesc/validators/common/AllContentModel.hpp>#include <xercesc/validators/schema/SubstitutionGroupComparator.hpp>#include <xercesc/validators/schema/XercesElementWildcard.hpp>XERCES_CPP_NAMESPACE_BEGIN// ---------------------------------------------------------------------------//  AllContentModel: Constructors and Destructor// ---------------------------------------------------------------------------AllContentModel::AllContentModel( ContentSpecNode* const parentContentSpec                                , const bool             isMixed                                , MemoryManager* const   manager) :   fMemoryManager(manager) , fCount(0) , fChildren(0) , fChildOptional(0) , fNumRequired(0) , fIsMixed(isMixed){    //    //  Create a vector of unsigned ints that will be filled in with the    //  ids of the child nodes. It will be expanded as needed but we give    //  it an initial capacity of 64 which should be more than enough for    //  99% of the scenarios.    //    ValueVectorOf<QName*> children(64, fMemoryManager);    ValueVectorOf<bool> childOptional(64, fMemoryManager);    //    //  Get the parent element's content spec. This is the head of the tree    //  of nodes that describes the content model. We will iterate this    //  tree.    //    ContentSpecNode* curNode = parentContentSpec;    if (!curNode)        ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::CM_NoParentCSN, fMemoryManager);    // And now call the private recursive method that iterates the tree    buildChildList(curNode, children, childOptional);    //    //  And now we know how many elements we need in our member list. So    //  fill them in.    //    fCount = children.size();    fChildren = (QName**) fMemoryManager->allocate(fCount * sizeof(QName*)); //new QName*[fCount];    fChildOptional = (bool*) fMemoryManager->allocate(fCount * sizeof(bool)); //new bool[fCount];    for (unsigned int index = 0; index < fCount; index++) {        fChildren[index] = new (fMemoryManager) QName(*(children.elementAt(index)));        fChildOptional[index] = childOptional.elementAt(index);    }}AllContentModel::~AllContentModel(){    for (unsigned int index = 0; index < fCount; index++)        delete fChildren[index];    fMemoryManager->deallocate(fChildren); //delete [] fChildren;    fMemoryManager->deallocate(fChildOptional); //delete [] fChildOptional;}// ---------------------------------------------------------------------------//  AllContentModel: Implementation of the ContentModel virtual interface// ---------------------------------------------------------------------------////Under the XML Schema mixed model,//the order and number of child elements appearing in an instance//must agree with//the order and number of child elements specified in the model.//intAllContentModel::validateContent( QName** const         children                                , const unsigned int    childCount                                , const unsigned int) const{    // If <all> had minOccurs of zero and there are    // no children to validate, trivially validate    if (!fNumRequired && !childCount)        return -1;    // Check for duplicate element    bool* elementSeen = (bool*) fMemoryManager->allocate(fCount*sizeof(bool)); //new bool[fCount];    // initialize the array    for (unsigned int i = 0; i < fCount; i++)        elementSeen[i] = false;    // keep track of the required element seen    unsigned int numRequiredSeen = 0;    for (unsigned int outIndex = 0; outIndex < childCount; outIndex++) {        // Get the current child out of the source index        const QName* curChild = children[outIndex];        // If its PCDATA, then we just accept that        if (fIsMixed && curChild->getURI() == XMLElementDecl::fgPCDataElemId)            continue;        // And try to find it in our list        unsigned int inIndex = 0;        for (; inIndex < fCount; inIndex++)        {            const QName* inChild = fChildren[inIndex];            if ((inChild->getURI() == curChild->getURI()) &&                (XMLString::equals(inChild->getLocalPart(), curChild->getLocalPart()))) {                // found it                // If this element was seen already, indicate an error was                // found at the duplicate index.                if (elementSeen[inIndex]) {                    fMemoryManager->deallocate(elementSeen); //delete [] elementSeen;                    return outIndex;                }                else                    elementSeen[inIndex] = true;                if (!fChildOptional[inIndex])                    numRequiredSeen++;                break;            }        }        // We did not find this one, so the validation failed        if (inIndex == fCount) {            fMemoryManager->deallocate(elementSeen); //delete [] elementSeen;            return outIndex;        }    }    fMemoryManager->deallocate(elementSeen); //delete [] elementSeen;    // Were all the required elements of the <all> encountered?    if (numRequiredSeen != fNumRequired) {        return childCount;    }    // Everything seems to be ok, so return success    // success    return -1;}int AllContentModel::validateContentSpecial(QName** const           children                                          , const unsigned int      childCount                                          , const unsigned int                                          , GrammarResolver*  const pGrammarResolver                                          , XMLStringPool*    const pStringPool) const{    SubstitutionGroupComparator comparator(pGrammarResolver, pStringPool);    // If <all> had minOccurs of zero and there are    // no children to validate, trivially validate    if (!fNumRequired && !childCount)        return -1;    // Check for duplicate element    bool* elementSeen = (bool*) fMemoryManager->allocate(fCount*sizeof(bool)); //new bool[fCount];    // initialize the array    for (unsigned int i = 0; i < fCount; i++)        elementSeen[i] = false;    // keep track of the required element seen    unsigned int numRequiredSeen = 0;    for (unsigned int outIndex = 0; outIndex < childCount; outIndex++) {        // Get the current child out of the source index        QName* const curChild = children[outIndex];        // If its PCDATA, then we just accept that        if (fIsMixed && curChild->getURI() == XMLElementDecl::fgPCDataElemId)            continue;        // And try to find it in our list        unsigned int inIndex = 0;        for (; inIndex < fCount; inIndex++)        {            QName* const inChild = fChildren[inIndex];            if ( comparator.isEquivalentTo(curChild, inChild)) {                // match                // If this element was seen already, indicate an error was                // found at the duplicate index.                if (elementSeen[inIndex]) {                    fMemoryManager->deallocate(elementSeen); //delete [] elementSeen;                    return outIndex;                }                else                    elementSeen[inIndex] = true;                if (!fChildOptional[inIndex])                    numRequiredSeen++;                break;            }        }        // We did not find this one, so the validation failed        if (inIndex == fCount) {            fMemoryManager->deallocate(elementSeen); //delete [] elementSeen;            return outIndex;        }    }    fMemoryManager->deallocate(elementSeen); //delete [] elementSeen;    // Were all the required elements of the <all> encountered?    if (numRequiredSeen != fNumRequired) {        return childCount;    }    // Everything seems to be ok, so return success    // success    return -1;}void AllContentModel::checkUniqueParticleAttribution    (        SchemaGrammar*    const pGrammar      , GrammarResolver*  const pGrammarResolver      , XMLStringPool*    const pStringPool      , XMLValidator*     const pValidator      , unsigned int*     const pContentSpecOrgURI      , const XMLCh*            pComplexTypeName /*= 0*/    ){    SubstitutionGroupComparator comparator(pGrammarResolver, pStringPool);    unsigned int i, j;    // rename back    for (i = 0; i < fCount; i++) {        unsigned int orgURIIndex = fChildren[i]->getURI();        fChildren[i]->setURI(pContentSpecOrgURI[orgURIIndex]);    }    // check whether there is conflict between any two leaves    for (i = 0; i < fCount; i++) {        for (j = i+1; j < fCount; j++) {            // If this is text in a Schema mixed content model, skip it.            if ( fIsMixed &&                 (( fChildren[i]->getURI() == XMLElementDecl::fgPCDataElemId) ||                  ( fChildren[j]->getURI() == XMLElementDecl::fgPCDataElemId)))                continue;            if (XercesElementWildcard::conflict(pGrammar,                                                ContentSpecNode::Leaf,                                                fChildren[i],                                                ContentSpecNode::Leaf,                                                fChildren[j],                                                &comparator)) {                pValidator->emitError(XMLValid::UniqueParticleAttributionFail,                                      pComplexTypeName,                                      fChildren[i]->getRawName(),                                      fChildren[j]->getRawName());             }         }    }}// ---------------------------------------------------------------------------//  AllContentModel: Private helper methods// ---------------------------------------------------------------------------voidAllContentModel::buildChildList(ContentSpecNode* const       curNode                              , ValueVectorOf<QName*>&       toFill                              , ValueVectorOf<bool>&         toOptional){    // Get the type of spec node our current node is    const ContentSpecNode::NodeTypes curType = curNode->getType();    if (curType == ContentSpecNode::All)    {        // Get both the child node pointers        ContentSpecNode* leftNode = curNode->getFirst();        ContentSpecNode* rightNode = curNode->getSecond();        // Recurse on the left and right nodes        buildChildList(leftNode, toFill, toOptional);        buildChildList(rightNode, toFill, toOptional);    }    else if (curType == ContentSpecNode::Leaf)    {        // At leaf, add the element to list of elements permitted in the all        toFill.addElement(curNode->getElement());        toOptional.addElement(false);        fNumRequired++;    }    else if (curType == ContentSpecNode::ZeroOrOne)    {        // At ZERO_OR_ONE node, subtree must be an element        // that was specified with minOccurs=0, maxOccurs=1        ContentSpecNode* leftNode = curNode->getFirst();        if (leftNode->getType() != ContentSpecNode::Leaf)            ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::CM_UnknownCMSpecType, fMemoryManager);        toFill.addElement(leftNode->getElement());        toOptional.addElement(true);    }    else        ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::CM_UnknownCMSpecType, fMemoryManager);}XERCES_CPP_NAMESPACE_END

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产视频一区不卡| 欧美日韩综合在线| 久久久精品tv| 国产成人综合精品三级| 久久久精品黄色| 成人夜色视频网站在线观看| 欧美经典一区二区三区| 成人自拍视频在线| 亚洲精选视频在线| 欧美日韩一区二区三区四区| 日韩电影免费在线观看网站| 日韩一二在线观看| 精品一区二区免费看| 国产欧美精品一区二区三区四区| 成人福利视频在线| 亚洲一区欧美一区| 欧美大片一区二区| 精品一区二区三区免费视频| 国产三级三级三级精品8ⅰ区| www.性欧美| 三级成人在线视频| 久久久国产精品午夜一区ai换脸| 99re这里只有精品首页| 午夜国产精品一区| 久久亚洲二区三区| 在线欧美日韩国产| 国产呦精品一区二区三区网站| 亚洲人成在线播放网站岛国| 欧美丰满少妇xxxxx高潮对白| 国产成人免费在线| 97成人超碰视| 天堂久久久久va久久久久| 国产午夜精品一区二区| 欧美性色黄大片手机版| 紧缚奴在线一区二区三区| 亚洲美女淫视频| 日韩欧美亚洲另类制服综合在线| 国产福利不卡视频| 欧美色倩网站大全免费| 亚洲女同ⅹxx女同tv| 韩国v欧美v日本v亚洲v| 欧美日韩高清在线| 一区在线中文字幕| 国产99精品国产| 日韩欧美一级在线播放| 中文字幕在线免费不卡| 日韩视频一区在线观看| 91在线观看免费视频| 国产一区二区三区四区在线观看 | 国产福利一区二区三区| 午夜精品久久久久久不卡8050| 国产日韩av一区| 精品福利一二区| 欧美日韩激情一区| 色噜噜狠狠色综合欧洲selulu| 韩国女主播一区二区三区| 视频一区欧美精品| 亚洲一区在线播放| 亚洲日本va在线观看| 欧美国产丝袜视频| 久久综合久久久久88| 欧美一区二区三区精品| 欧美在线色视频| 色综合天天综合狠狠| 成人综合婷婷国产精品久久免费| 精品一区二区三区在线观看 | 911精品产国品一二三产区| 91丨porny丨最新| av欧美精品.com| jvid福利写真一区二区三区| 国产91精品一区二区| 国产精品一区久久久久| 国产揄拍国内精品对白| 国产精品夜夜嗨| 丰满放荡岳乱妇91ww| 国产成人综合视频| 成人丝袜视频网| fc2成人免费人成在线观看播放| 国产电影一区在线| 成人一区二区三区在线观看| 成人精品视频.| 91丨porny丨户外露出| 99久久99久久精品国产片果冻| 97久久精品人人爽人人爽蜜臀 | 91在线播放网址| 色综合久久综合网97色综合| 一本色道久久加勒比精品| 色av成人天堂桃色av| 欧美吞精做爰啪啪高潮| 制服丝袜av成人在线看| 日韩三级av在线播放| 久久综合五月天婷婷伊人| 欧美激情一区不卡| 亚洲精品欧美综合四区| 午夜av区久久| 麻豆国产一区二区| 国产成人午夜高潮毛片| 91视频国产观看| 欧美福利电影网| 久久精品免费在线观看| 18成人在线观看| 午夜精品久久久久久久蜜桃app| 美国十次综合导航| 成人精品亚洲人成在线| 欧美三级视频在线播放| 精品黑人一区二区三区久久| 国产精品嫩草99a| 亚洲一区二区在线免费观看视频| 日本大胆欧美人术艺术动态 | 国产精品毛片高清在线完整版| 亚洲欧美偷拍三级| 婷婷亚洲久悠悠色悠在线播放| 久久99精品久久久| 99久久精品国产毛片| 51午夜精品国产| 久久久91精品国产一区二区精品 | 精品日韩成人av| 亚洲欧洲日韩av| 琪琪久久久久日韩精品| 福利91精品一区二区三区| 日本精品一级二级| 国产亚洲精品资源在线26u| 亚洲日本电影在线| 久久99蜜桃精品| 色综合久久99| 欧美电视剧在线观看完整版| 亚洲欧美日韩国产另类专区| 精品一区二区在线观看| 欧美色男人天堂| 亚洲欧洲日韩一区二区三区| 美女视频黄a大片欧美| 欧日韩精品视频| 久久久激情视频| 免费在线视频一区| 日本久久一区二区| 国产精品每日更新在线播放网址| 麻豆精品在线看| 欧美日韩在线电影| 自拍偷拍国产精品| 国产二区国产一区在线观看| 91精品国产综合久久久蜜臀粉嫩 | 欧美一区二区三区成人| 一区二区在线观看免费| 国产一区二区三区免费在线观看| 欧美三级电影在线观看| 亚洲欧美日韩久久| 成人app在线观看| 久久九九全国免费| 国产专区综合网| 欧美va亚洲va在线观看蝴蝶网| 亚洲国产精品天堂| 欧美性做爰猛烈叫床潮| 成人免费在线视频观看| 国产91高潮流白浆在线麻豆| 精品久久久久久久人人人人传媒| 日本视频免费一区| 欧美一区午夜视频在线观看| 亚洲欧美另类图片小说| 91亚洲国产成人精品一区二区三 | 日韩午夜av一区| 天堂成人国产精品一区| 欧美精品在线视频| 亚洲成人精品影院| 欧美日韩国产免费| 亚洲mv大片欧洲mv大片精品| 色婷婷综合在线| 国产精品区一区二区三| 亚洲一区二区五区| 在线观看国产日韩| 亚洲欧美色一区| 在线观看av不卡| 亚洲日本在线观看| 成人性生交大片| 日韩伦理av电影| 成人精品国产福利| 国产欧美一区二区三区在线老狼| 成人一区在线观看| 国产日韩欧美高清在线| 久久69国产一区二区蜜臀| 9i在线看片成人免费| 一二三区精品视频| 91久久精品午夜一区二区| 亚洲免费成人av| 欧美高清激情brazzers| 偷拍一区二区三区四区| 欧美三级视频在线| 老司机精品视频线观看86| 日韩欧美在线网站| 久久电影国产免费久久电影| 久久久亚洲精品石原莉奈 | 欧美高清视频不卡网| 亚洲美女一区二区三区| 日韩一区二区中文字幕| 麻豆久久一区二区| www成人在线观看| 91网站在线播放| 亚洲无人区一区| 91麻豆精品国产无毒不卡在线观看| 裸体健美xxxx欧美裸体表演| 欧美xxx久久|