当前位置: 首页>>代码示例>>C++>>正文


C++ XMLElementDecl::getBaseName方法代码示例

本文整理汇总了C++中XMLElementDecl::getBaseName方法的典型用法代码示例。如果您正苦于以下问题:C++ XMLElementDecl::getBaseName方法的具体用法?C++ XMLElementDecl::getBaseName怎么用?C++ XMLElementDecl::getBaseName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XMLElementDecl的用法示例。


在下文中一共展示了XMLElementDecl::getBaseName方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: endElement

void SAXParser::endElement( const   XMLElementDecl& elemDecl
                            , const unsigned int    uriId
                            , const bool            isRoot
                            , const XMLCh* const    elemPrefix)
{
    // Just map to the SAX document handler
    if (fDocHandler) {
        if (fScanner->getDoNamespaces()) {

            if (elemPrefix && *elemPrefix) {

                fElemQNameBuf.set(elemPrefix);
                fElemQNameBuf.append(chColon);
                fElemQNameBuf.append(elemDecl.getBaseName());
                fDocHandler->endElement(fElemQNameBuf.getRawBuffer());
            }
            else {
                fDocHandler->endElement(elemDecl.getBaseName());
            }
        }
        else
            fDocHandler->endElement(elemDecl.getFullName());

    }

    //
    //  If there are any installed advanced handlers, then lets call them
    //  with this info.
    //
    for (XMLSize_t index = 0; index < fAdvDHCount; index++)
        fAdvDHList[index]->endElement(elemDecl, uriId, isRoot, elemPrefix);

    //
    //  Dump the element depth down again. Don't let it underflow in case
    //  of malformed XML.
    //
    if (fElemDepth)
        fElemDepth--;
}
开发者ID:AuditoryBiophysicsLab,项目名称:EarLab,代码行数:39,代码来源:SAXParser.cpp

示例2: getURIText

void NsSAX2Reader::endElement(const XMLElementDecl& elemDecl,
			       const unsigned int uriId,
			       const_bool isRoot,
			       const XMLCh* const elemPrefix)
{
	const XMLCh *uri = 0;
	if (uriId >= DBXML_MIN_URI && getDoNamespaces())
		uri = getURIText(uriId);
	fHandler->endElement(elemDecl.getBaseName(),
			     (elemPrefix && *elemPrefix) ? elemPrefix : 0,
			     uri);
	//
	//  Dump the element depth down again. Don't let it underflow in case
	//  of malformed XML.
	//
	if (fElemDepth)
		fElemDepth--;
}
开发者ID:kanbang,项目名称:Colt,代码行数:18,代码来源:NsSAX2Reader.cpp

示例3: endElement

void TestParser::endElement(const   XMLElementDecl& elemDecl
                            , const unsigned int    uriId
                            , const bool            isRoot)
{
    if (fOutputType == OutputType_Debug)
    {
        if (fDoNamespaces)
        {
            XMLBuffer bufURI;
            fScanner->getURIText(uriId, bufURI);

            XERCES_STD_QUALIFIER cout << "Got ENDELEMENT:\n    Name: "
                 << "{" << StrX(bufURI.getRawBuffer()) << "}"
                 << StrX(elemDecl.getBaseName())
                 << XERCES_STD_QUALIFIER endl;
        }
         else
        {
            XERCES_STD_QUALIFIER cout << "Got ENDELEMENT:\n    Name: "
                 << StrX(elemDecl.getFullName()) << XERCES_STD_QUALIFIER endl;
        }

        XERCES_STD_QUALIFIER cout << "    SrcOfs: " << fScanner->getSrcOffset()
             << "\n" << XERCES_STD_QUALIFIER endl;
    }
     else if ((fOutputType == OutputType_XML)
          ||  (fOutputType == OutputType_JCCanon)
          ||  (fOutputType == OutputType_SunCanon))
    {
        XERCES_STD_QUALIFIER cout << "</";
        showString(elemDecl.getFullName());
        XERCES_STD_QUALIFIER cout << ">";
    }

    // Clear the flag that says we're now inside the root
    if (isRoot)
        fInsideRoot = false;
}
开发者ID:appleseedhq,项目名称:appleseed-deps,代码行数:38,代码来源:ParserTest_Parser.cpp

示例4: alist

void NsSAX2Reader::startElement(
	const XMLElementDecl& elemDecl,
	const unsigned int elemURLId,
	const XMLCh* const elemPrefix,
	const RefVectorOf<XMLAttr>& attrList,
	const XercesSizeUint attrCount,
	const_bool isEmpty,
	const_bool isRoot)
{
	NsEventAttrListXimpl alist(attrList, *this, (unsigned int)attrCount);
	const XMLCh *uri = 0;
	unsigned int uriId = elemURLId;
	if (uriId >= DBXML_MIN_URI && getDoNamespaces())
		uri = getURIText(elemURLId);
	fHandler->startElement(elemDecl.getBaseName(),
			       (elemPrefix && *elemPrefix) ? elemPrefix : 0,
			       uri, &alist, (unsigned int)attrCount,
			       isEmpty);

	// Bump the element depth counter if not empty
	if (!isEmpty)
		fElemDepth++;
}
开发者ID:kanbang,项目名称:Colt,代码行数:23,代码来源:NsSAX2Reader.cpp

示例5:

void SAXParser::
startElement(   const   XMLElementDecl&         elemDecl
                , const unsigned int            elemURLId
                , const XMLCh* const            elemPrefix
                , const RefVectorOf<XMLAttr>&   attrList
                , const XMLSize_t               attrCount
                , const bool                    isEmpty
                , const bool                    isRoot)
{
    // Bump the element depth counter if not empty
    if (!isEmpty)
        fElemDepth++;

    if (fDocHandler)
    {
        fAttrList.setVector(&attrList, attrCount);
        if (fScanner->getDoNamespaces()) {

            if (elemPrefix && *elemPrefix) {

                fElemQNameBuf.set(elemPrefix);
                fElemQNameBuf.append(chColon);
                fElemQNameBuf.append(elemDecl.getBaseName());
                fDocHandler->startElement(fElemQNameBuf.getRawBuffer(), fAttrList);

                // If its empty, send the end tag event now
                if (isEmpty && fDocHandler)
                    fDocHandler->endElement(fElemQNameBuf.getRawBuffer());
            }
            else {

                fDocHandler->startElement(elemDecl.getBaseName(), fAttrList);

                // If its empty, send the end tag event now
                if (isEmpty && fDocHandler)
                    fDocHandler->endElement(elemDecl.getBaseName());
            }
        }
        else {
            fDocHandler->startElement(elemDecl.getFullName(), fAttrList);

            // If its empty, send the end tag event now
            if (isEmpty && fDocHandler)
                fDocHandler->endElement(elemDecl.getFullName());
        }
    }

    //
    //  If there are any installed advanced handlers, then lets call them
    //  with this info.
    //
    for (XMLSize_t index = 0; index < fAdvDHCount; index++)
    {
        fAdvDHList[index]->startElement
        (
            elemDecl
            , elemURLId
            , elemPrefix
            , attrList
            , attrCount
            , isEmpty
            , isRoot
        );
    }
}
开发者ID:AuditoryBiophysicsLab,项目名称:EarLab,代码行数:65,代码来源:SAXParser.cpp

示例6: scanStartTag


//.........这里部分代码省略.........
        uriId, nameRawBuf, qnameRawBuf, currentScope
    );

    if (!elemDecl)
    {
        // URI is different, so we try to switch grammar
        if (uriId != fURIStringPool->getId(fGrammar->getTargetNamespace())) {
            switchGrammar(getURIText(uriId), laxThisOne);
        }

        // look for a global element declaration
        elemDecl = fGrammar->getElemDecl(
            uriId, nameRawBuf, qnameRawBuf, Grammar::TOP_LEVEL_SCOPE
        );

        if (!elemDecl)
        {
            // if still not found, look in list of undeclared elements
            elemDecl = fElemNonDeclPool->getByKey(
                nameRawBuf, uriId, Grammar::TOP_LEVEL_SCOPE);

            if (!elemDecl)
            {
                elemDecl = new (fMemoryManager) SchemaElementDecl
                (
                    fPrefixBuf.getRawBuffer(), nameRawBuf, uriId
                    , SchemaElementDecl::Any, Grammar::TOP_LEVEL_SCOPE
                    , fMemoryManager
                );
                elemDecl->setId
                (
                    fElemNonDeclPool->put
                    (
                        (void*)elemDecl->getBaseName(), uriId
                        , Grammar::TOP_LEVEL_SCOPE, (SchemaElementDecl*)elemDecl
                    )
                );
                wasAdded = true;
            }
		}
    }

    //  We do something different here according to whether we found the
    //  element or not.
    if (wasAdded || !elemDecl->isDeclared())
    {
        if (laxThisOne) {
            fValidate = false;
            fElemStack.setValidationFlag(fValidate);
        }

        // If validating then emit an error
        if (fValidate)
        {
            // This is to tell the reuse Validator that this element was
            // faulted-in, was not an element in the grammar pool originally
            elemDecl->setCreateReason(XMLElementDecl::JustFaultIn);

            fValidator->emitError
            (
                XMLValid::ElementNotDefined, elemDecl->getFullName()
            );
        }
    }

    //  Now we can update the element stack to set the current element
开发者ID:gitrider,项目名称:wxsj2,代码行数:67,代码来源:XSAXMLScanner.cpp

示例7: startElement

// ---------------------------------------------------------------------------
//  XSDDOMParser: Implementation of the XMLDocumentHandler interface
// ---------------------------------------------------------------------------
void XSDDOMParser::startElement( const XMLElementDecl&       elemDecl
                               , const unsigned int          urlId
                               , const XMLCh* const          elemPrefix
                               , const RefVectorOf<XMLAttr>& attrList
                               , const unsigned int          attrCount
                               , const bool                  isEmpty
                               , const bool                  isRoot)
{
    fDepth++;

    // while it is true that non-whitespace character data
    // may only occur in appInfo or documentation
    // elements, it's certainly legal for comments and PI's to
    // occur as children of annotation; we need
    // to account for these here.
    if (fAnnotationDepth == -1)
    {
        if (XMLString::equals(elemDecl.getBaseName(), SchemaSymbols::fgELT_ANNOTATION) &&
            XMLString::equals(getURIText(urlId), SchemaSymbols::fgURI_SCHEMAFORSCHEMA))
        {

            fAnnotationDepth = fDepth;
            startAnnotation(elemDecl, attrList, attrCount);
        } 
    }
    else if (fDepth == fAnnotationDepth+1)
    {
        fInnerAnnotationDepth = fDepth;
        startAnnotationElement(elemDecl, attrList, attrCount);
    }
    else
    {
        startAnnotationElement(elemDecl, attrList, attrCount);
        // avoid falling through; don't call startElement in this case
        return;
    }

    DOMElement *elem;
    if (urlId != fScanner->getEmptyNamespaceId())  //TagName has a prefix
    {
        if (elemPrefix && *elemPrefix)
        {
            XMLBufBid elemQName(&fBufMgr);
            elemQName.set(elemPrefix);
            elemQName.append(chColon);
            elemQName.append(elemDecl.getBaseName());
            elem = createElementNSNode(
                fScanner->getURIText(urlId), elemQName.getRawBuffer());
        }
        else {
            elem = createElementNSNode(
                fScanner->getURIText(urlId), elemDecl.getBaseName());
        }
    }
    else {
        elem = createElementNSNode(0, elemDecl.getBaseName());
    }

    DOMElementImpl *elemImpl = (DOMElementImpl *) elem;
    for (unsigned int index = 0; index < attrCount; ++index)
    {
        const XMLAttr* oneAttrib = attrList.elementAt(index);
        unsigned int attrURIId = oneAttrib->getURIId();
        const XMLCh* namespaceURI = 0;

        //for xmlns=...
        if (XMLString::equals(oneAttrib->getName(), XMLUni::fgXMLNSString))
            attrURIId = fScanner->getXMLNSNamespaceId();

        //TagName has a prefix
        if (attrURIId != fScanner->getEmptyNamespaceId())
            namespaceURI = fScanner->getURIText(attrURIId); //get namespaceURI

        //  revisit.  Optimize to init the named node map to the
        //            right size up front.
        DOMAttrImpl *attr = (DOMAttrImpl *)
            fDocument->createAttributeNS(namespaceURI, oneAttrib->getQName());
        attr->setValue(oneAttrib -> getValue());
        DOMNode* remAttr = elemImpl->setAttributeNodeNS(attr);
        if (remAttr)
            remAttr->release();

        // Attributes of type ID.  If this is one, add it to the hashtable of IDs
        //   that is constructed for use by GetElementByID().
        if (oneAttrib->getType()==XMLAttDef::ID)
        {
            if (fDocument->fNodeIDMap == 0)
                fDocument->fNodeIDMap = new (fDocument) DOMNodeIDMap(500, fDocument);
            fDocument->fNodeIDMap->add(attr);
            attr->fNode.isIdAttr(true);
        }

        attr->setSpecified(oneAttrib->getSpecified());
    }

    // set up the default attributes
    if (elemDecl.hasAttDefs())
//.........这里部分代码省略.........
开发者ID:js422,项目名称:PERL,代码行数:101,代码来源:XSDDOMParser.cpp

示例8: if

void
TestParser::startElement(const  XMLElementDecl&         elemDecl
                        , const unsigned int            uriId
                        , const XMLCh* const            prefixName
                        , const RefVectorOf<XMLAttr>&   attrList
                        , const unsigned int            attCount
                        , const bool                    isEmpty
                        , const bool                    isRoot)
{
    // Set the flag that says we're now inside the root, if its not empty
    if (isRoot && !isEmpty)
        fInsideRoot = true;

    if (fOutputType == OutputType_Debug)
    {
        XMLBuffer bufURI;
        if (fDoNamespaces)
        {
            fScanner->getURIText(uriId, bufURI);
            XERCES_STD_QUALIFIER cout << "Got STARTELEMENT:\n    "
                 << " Name: {" << StrX(bufURI.getRawBuffer()) << "}"
                 << StrX(elemDecl.getBaseName())
                 << ", AttCount: " << attCount
                 << ", Empty?: "
                 << (isEmpty ? "yes" : "no")
                 << "\n";
        }
         else
        {
            XERCES_STD_QUALIFIER cout << "Got STARTELEMENT:\n    Name: "
                 << StrX(elemDecl.getFullName())
                 << ", AttCount: " << attCount
                 << ", Empty?: "
                 << (isEmpty ? "yes" : "no")
                 << "\n";
        }

        XERCES_STD_QUALIFIER cout << "    SrcOfs: " << fScanner->getSrcOffset() << "\n";

        // If any attributes, then show them
        if (attCount)
        {
            XERCES_STD_QUALIFIER cout << "    Attrs: ";
            for (unsigned int attInd = 0; attInd < attCount; attInd++)
            {
                const XMLAttr* curAttr = attrList.elementAt(attInd);

                if (fDoNamespaces)
                {
                    fScanner->getURIText(curAttr->getURIId(), bufURI);
                    XERCES_STD_QUALIFIER cout << "Name=" << "{" << StrX(bufURI.getRawBuffer())
                         << "}" << StrX(curAttr->getName());
                }
                 else
                {
                    XERCES_STD_QUALIFIER cout << "Name=" << StrX(curAttr->getQName());
                }

                if (curAttr->getSpecified())
                    XERCES_STD_QUALIFIER cout << " (Explicit)  ";
                else
                    XERCES_STD_QUALIFIER cout << " (Defaulted) ";

                XERCES_STD_QUALIFIER cout << "Value=" << StrX(curAttr->getValue()) << "\n"
                     << "           ";
            }
        }

        XERCES_STD_QUALIFIER cout << XERCES_STD_QUALIFIER endl;
    }
     else if (fOutputType == OutputType_XML)
    {
        XERCES_STD_QUALIFIER cout << "<";
        showString(elemDecl.getFullName());

        if (attCount)
        {
            XERCES_STD_QUALIFIER cout << " ";

            for (unsigned int index = 0; index < attCount; index++)
            {
                const XMLAttr* curAttr = attrList.elementAt(index);
                showString(curAttr->getQName());
                XERCES_STD_QUALIFIER cout << "=\"";
                showString(curAttr->getValue());
                XERCES_STD_QUALIFIER cout << "\"";

                if (index < attCount-1)
                    XERCES_STD_QUALIFIER cout << " ";
            }
        }

        if (isEmpty)
            XERCES_STD_QUALIFIER cout << "/>";
        else
            XERCES_STD_QUALIFIER cout << ">";
    }
     else if ((fOutputType == OutputType_JCCanon)
          ||  (fOutputType == OutputType_SunCanon))
    {
//.........这里部分代码省略.........
开发者ID:appleseedhq,项目名称:appleseed-deps,代码行数:101,代码来源:ParserTest_Parser.cpp


注:本文中的XMLElementDecl::getBaseName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。