本文整理汇总了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;
}
示例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;
}
示例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)
{