本文整理汇总了C++中DOMElement::getLocalName方法的典型用法代码示例。如果您正苦于以下问题:C++ DOMElement::getLocalName方法的具体用法?C++ DOMElement::getLocalName怎么用?C++ DOMElement::getLocalName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DOMElement
的用法示例。
在下文中一共展示了DOMElement::getLocalName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TextNode_Update
void DeltaApplyEngine::TextNode_Update( XID_t nodeXID, DOMNode *operationNode ) {
vddprintf((" update xid=%d\n",(int)nodeXID));
DOMNode* upNode = xiddoc->getXidMap().getNodeWithXID( nodeXID );
if (upNode==NULL) THROW_AWAY(("node with XID=%d not found",(int)nodeXID));
DOMNodeList *opNodes = operationNode->getChildNodes();
vddprintf(("opNodes->length() = %d\n", opNodes->getLength()));
XyStrDeltaApply *xytext = new XyStrDeltaApply(xiddoc, upNode, 1);
xytext->setApplyAnnotations(applyAnnotations);
for (int i = opNodes->getLength() - 1; i >= 0; i--) {
DOMElement *op = (DOMElement *) opNodes->item(i);
char *optype = XMLString::transcode(op->getLocalName());
XMLCh pos_attr[4];
XMLCh len_attr[4];
XMLString::transcode("pos", pos_attr, 3);
XMLString::transcode("len", len_attr, 3);
vddprintf(("item %d = %s\n", i, optype));
// Replace operation
if (strcmp(optype, "tr") == 0) {
char *pos = XMLString::transcode(op->getAttribute(pos_attr));
char *len = XMLString::transcode(op->getAttribute(len_attr));
xytext->replace(atoi(pos), atoi(len), op->getTextContent());
XMLString::release(&pos);
XMLString::release(&len);
}
// Delete operation
else if (strcmp(optype, "td") == 0) {
char *pos = XMLString::transcode(op->getAttribute(pos_attr));
char *len = XMLString::transcode(op->getAttribute(len_attr));
xytext->remove(atoi(pos), atoi(len));
XMLString::release(&pos);
XMLString::release(&len);
}
// Insert operation
else if (strcmp(optype, "ti") == 0) {
char *pos = XMLString::transcode(op->getAttribute(pos_attr));
xytext->insert(atoi(pos), op->getTextContent());
XMLString::release(&pos);
}
XMLString::release(&optype);
}
xytext->complete();
delete xytext;
}
示例2: convert
musicxml::score_timewise
musicxml::parse<musicxml::score_timewise>(std::istream &is,
const std::string &id) {
xml::auto_initializer xerces_platform { true, false };
std::unique_ptr<DOMDocument> doc { dom_document(is, id, true) };
DOMElement *root { doc->getDocumentElement() };
std::string const ns { xml::transcode<char>(root->getNamespaceURI()) };
std::string const name { xml::transcode<char>(root->getLocalName()) };
if (ns == "") {
if (name == "score-partwise") {
return musicxml::convert(musicxml::score_partwise{*root});
} else if (name == "score-timewise") {
return musicxml::score_timewise{*root};
}
}
throw tree::unexpected_element<char>(name, ns,
"score-partwise|score-timewise", "");
}
示例3: if
DOMElement*
SchemaInfo::getTopLevelComponent(const unsigned short compCategory,
const XMLCh* const compName,
const XMLCh* const name) {
if (compCategory >= C_Count)
return 0;
DOMElement* child = XUtil::getFirstChildElement(fSchemaRootElement);
if (!child)
return 0;
RefHashTableOf<DOMElement>* compList = fTopLevelComponents[compCategory];
if (fTopLevelComponents[compCategory] == 0) {
compList= new (fMemoryManager) RefHashTableOf<DOMElement>(17, false, fMemoryManager);
fTopLevelComponents[compCategory] = compList;
}
else {
DOMElement* cachedChild = compList->get(name);
if(cachedChild)
return cachedChild;
child = fLastTopLevelComponent[compCategory];
}
DOMElement* redefParent = (DOMElement*) child->getParentNode();
// Parent is not "redefine"
if (!XMLString::equals(redefParent->getLocalName(),SchemaSymbols::fgELT_REDEFINE))
redefParent = 0;
while (child != 0) {
fLastTopLevelComponent[compCategory]=child;
if (XMLString::equals(child->getLocalName(), compName)) {
const XMLCh* cName=child->getAttribute(SchemaSymbols::fgATT_NAME);
compList->put((void*)cName, child);
if (XMLString::equals(cName, name))
return child;
}
else if (XMLString::equals(child->getLocalName(),SchemaSymbols::fgELT_REDEFINE)
&& (!fFailedRedefineList || !fFailedRedefineList->containsElement(child))) { // if redefine
DOMElement* redefineChild = XUtil::getFirstChildElement(child);
while (redefineChild != 0) {
fLastTopLevelComponent[compCategory]=redefineChild;
if ((!fFailedRedefineList || !fFailedRedefineList->containsElement(redefineChild))
&& XMLString::equals(redefineChild->getLocalName(), compName)) {
const XMLCh* rName=redefineChild->getAttribute(SchemaSymbols::fgATT_NAME);
compList->put((void*)rName, redefineChild);
if (XMLString::equals(rName, name))
return redefineChild;
}
redefineChild = XUtil::getNextSiblingElement(redefineChild);
}
}
child = XUtil::getNextSiblingElement(child);
if (child == 0 && redefParent) {
child = XUtil::getNextSiblingElement(redefParent);
redefParent = 0;
}
}
return child;
}