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


C++ DOMAttr::getNodeValue方法代码示例

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


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

示例1: CopyAttr

bool CopyAttr(DOMElement *target, const DOMElement *source, const XMLCh* attrName, bool MustBeFound=true) {
	DOMAttr *attrNode = source->getAttributeNode(attrName);
	if (attrNode==NULL) {
		if (MustBeFound==true) {
			THROW_AWAY(("Mandatory Attribute on Delta Operation Node was not found for CopyAttr()"));
		}
		else return false;
	}
	target->setAttribute(attrName, attrNode->getNodeValue());
	return true;
}
开发者ID:alon,项目名称:xydiff,代码行数:11,代码来源:DeltaReverse.cpp

示例2: attribute

	bool Manager::attribute(const DOMNode* n,const u_str attrname) {
		bool result=false;
		if (n != nullptr && !attrname.empty() && n->getNodeType() == DOMNode::ELEMENT_NODE ) {
			DOMElement* enod = (DOMElement*)n;
			DOMAttr* enoda = enod->getAttributeNode(pcx(attrname.c_str()));
			if (enoda != nullptr) {
				const XMLCh* x_attrval = enoda->getNodeValue();
				if (x_attrval != nullptr && x_attrval[0] != 0 ) {
					result = true; //only true if result is not empty.
				}
			}
		}
		return result;
	}
开发者ID:RedSnapper,项目名称:Obyx,代码行数:14,代码来源:manager.cpp

示例3: if


//.........这里部分代码省略.........
                    parseDOMNodeDoingXInclude(childNode, parsedDocument, entityResolver);
                }
                modifiedNode = true;
            } else {
                /* empty fallback element - simply remove it! */
                includeParent->removeChild(xincludeNode);
                modifiedNode = true;
            }
        } else {
            XIncludeUtils::reportError(xincludeNode, XMLErrs::XIncludeIncludeFailedNoFallback,
                parsedDocument->getDocumentURI(), parsedDocument->getDocumentURI());
            return false;
        }
    } else {
        if (includedDoc){
            /* record the successful include while we process the children */
            addDocumentURIToCurrentInclusionHistoryStack(hrefLoc.getLocation());

            DOMDocumentFragment* frag = parsedDocument->createDocumentFragment();
            /* need to import the document prolog here */
            DOMNode *child = includedDoc->getFirstChild();
            for (; child != NULL; child = child->getNextSibling()) {
                if (child->getNodeType() == DOMNode::DOCUMENT_TYPE_NODE)
                    continue;
                // check for NOTATION or ENTITY clash
                if(child->getNodeType()==DOMNode::ELEMENT_NODE && includedDoc->getDoctype()!=NULL) {
                    DOMNamedNodeMap *pAttributes = child->getAttributes();
                    XMLSize_t nSize = pAttributes->getLength();
                    for(XMLSize_t i=0;i<nSize;++i) {
                        DOMAttr *pAttributeNode = (DOMAttr*) pAttributes->item(i);
                        const DOMTypeInfo * typeInfo=pAttributeNode->getSchemaTypeInfo();
                        if(typeInfo && XMLString::equals(typeInfo->getTypeNamespace(), XMLUni::fgInfosetURIName)) {
                            if(XMLString::equals(typeInfo->getTypeName(), XMLUni::fgNotationString)) {
                                const XMLCh* notationName=pAttributeNode->getNodeValue();
                                DOMNotation* notat=(DOMNotation*)includedDoc->getDoctype()->getNotations()->getNamedItem(notationName);
                                // ensure we have a DTD
                                if(parsedDocument->getDoctype()==NULL)
                                    parsedDocument->insertBefore(parsedDocument->createDocumentType(parsedDocument->getDocumentElement()->getNodeName(), NULL,NULL), parsedDocument->getFirstChild());
                                DOMNotation* myNotation=(DOMNotation*)parsedDocument->getDoctype()->getNotations()->getNamedItem(notationName);
                                if(myNotation==NULL)
                                {
                                    // it's missing, add it
                                    parsedDocument->getDoctype()->getNotations()->setNamedItem(parsedDocument->importNode(notat, true));
                                }
                                else if(XMLString::equals(myNotation->getPublicId(), notat->getPublicId()) &&
                                        XMLString::equals(myNotation->getSystemId(), notat->getSystemId()) &&
                                        XMLString::equals(myNotation->getBaseURI(), notat->getBaseURI()))
                                {
                                    // it's duplicate, ignore it
                                }
                                else
                                {
                                    // it's a conflict, report it
                                    XIncludeUtils::reportError(xincludeNode, XMLErrs::XIncludeConflictingNotation,
                                        notationName, parsedDocument->getDocumentURI());
                                }
                            }
                            else if(XMLString::equals(typeInfo->getTypeName(), XMLUni::fgEntityString)) {
                                const XMLCh* entityName=pAttributeNode->getNodeValue();
                                DOMEntity* ent=(DOMEntity*)includedDoc->getDoctype()->getEntities()->getNamedItem(entityName);
                                // ensure we have a DTD
                                if(parsedDocument->getDoctype()==NULL)
                                    parsedDocument->insertBefore(parsedDocument->createDocumentType(parsedDocument->getDocumentElement()->getNodeName(), NULL,NULL), parsedDocument->getFirstChild());
                                DOMEntity* myEnt=(DOMEntity*)parsedDocument->getDoctype()->getEntities()->getNamedItem(entityName);
                                if(myEnt==NULL)
                                {
开发者ID:kanbang,项目名称:Colt,代码行数:67,代码来源:XIncludeUtils.cpp


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