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


C++ DOMNode::getPreviousSibling方法代码示例

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


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

示例1: getText

string XmlElement::getText() const { // return the empty string if there is no text
    DOMNode* first = base->getFirstChild();
    while(first) {
        if (first->getNodeType() == 3) {
            char* ctext (XMLString::transcode(first->getNodeValue()));
            string text(ctext);
            XMLString::release(&ctext);
            return text;
        }
        first = first->getPreviousSibling();
    }
    return string();
}
开发者ID:8l,项目名称:insieme,代码行数:13,代码来源:xml_utils.cpp

示例2: unrollList

void SortDeleteOperationsEngine::unrollList(XID_DOMDocument *sourceDoc, DOMNode *node) {
	
	if (node->hasChildNodes()) {
		DOMNode* child = node->getLastChild();
		while(child!=NULL) {
			unrollList(sourceDoc, child);
			child=child->getPreviousSibling();
			}
		}
	
	XID_t myXid = sourceDoc->getXidMap().getXIDbyNode(node);
	std::map<XID_t, DOMNode*>::iterator p = operationBySourceNode.find((long)myXid);
	if (p!=operationBySourceNode.end()) theList.push_back(p->second);

	}
开发者ID:alon,项目名称:xydiff,代码行数:15,代码来源:DeltaSortOperations.cpp

示例3: setText

void XmlElement::setText(const string& text) {
    assert(doc != NULL && "Attempt to create text on a root node");
    DOMNode* first = base->getFirstChild();
    bool found = false;
    while(first && !found) {
        if (first->getNodeType() == 3) {
            first->setTextContent(toUnicode(text));
            found = true;
        }
        first = first->getPreviousSibling();
    }
    if (!found) {
        DOMText* textNode = doc->createTextNode(toUnicode(text));
        base->appendChild(textNode);
    }
}
开发者ID:8l,项目名称:insieme,代码行数:16,代码来源:xml_utils.cpp

示例4: getPreviousLogicalSibling

// Returns the previous logical sibling with respect to the given node.
DOMNode* DOMElementImpl::getPreviousLogicalSibling(const DOMNode* n) const
{
    DOMNode* prev = n->getPreviousSibling();
    // If "n" has no previous sibling and its parent is an entity reference node we
    // need to continue the search through the previous siblings of the entity
    // reference as these are logically siblings of the given node.
    if (prev == NULL) {
        DOMNode* parent = n->getParentNode();
        while (parent != NULL && parent->getNodeType() == DOMNode::ENTITY_REFERENCE_NODE) {
            prev = parent->getPreviousSibling();
            if (prev != NULL) {
                break;
            }
            parent = parent->getParentNode();
        }
    }
    return prev;
}
开发者ID:AmesianX,项目名称:Sigil,代码行数:19,代码来源:DOMElementImpl.cpp

示例5: IConfigItemPtr

SYSTEM::IConfigItemPtr SYSTEM::CConfigItem::GetLastChild()
{
	DOMNode *LastChild = ((DOMElement*)itemElement)->getLastChild();
	if(LastChild == NULL)
		return NULL;
	
	while(LastChild != NULL && LastChild->getNodeType() == DOMNode::TEXT_NODE)
		LastChild = LastChild->getPreviousSibling();

	if(LastChild == NULL)
		return NULL;

	CConfigItem* item = new CConfigItem;
	item->itemElement = LastChild;
	item->doc = doc;
	
	return IConfigItemPtr((IConfigItem*)item);
}
开发者ID:lozpeng,项目名称:applesales,代码行数:18,代码来源:ConfigItem.cpp

示例6: getLastChild

DOMElement * DOMElementImpl::getLastElementChild() const
{
    DOMNode* n = getLastChild();
    while (n != NULL) {
        switch (n->getNodeType()) {
            case DOMNode::ELEMENT_NODE:
                return (DOMElement*) n;
            case DOMNode::ENTITY_REFERENCE_NODE:
                {
                    DOMElement* e = getLastElementChild(n);
                    if (e != NULL)
                        return e;
                }
                break;
            default:
                break;
        }
        n = n->getPreviousSibling();
    }
    return NULL;
}
开发者ID:AmesianX,项目名称:Sigil,代码行数:21,代码来源:DOMElementImpl.cpp

示例7: while

DOMComment *XmlParser::getCommentNode(DOMElement *element) {
   DOMNode *node = element;
   do {
      node = node->getPreviousSibling();
      if (node == NULL) {
//         cerr << "getCommentNode() - no prior comment sibling\n";
         return NULL;
      }
   } while (node->getNodeType() == DOMNode::TEXT_NODE);

   DOMComment *el = NULL;
   if (node->getNodeType() == DOMNode::COMMENT_NODE) {
      el = dynamic_cast< xercesc::DOMComment* >( node );
      if (el == NULL) {
         cerr << "getCommentNode() - cast failed\n";
      }
   }
   else {
//      cerr << "getCommentNode() - no comment found - type :" << node->getNodeType() << endl;
   }
   return el;
}
开发者ID:CoffeeHacker,项目名称:usbdm-eclipse-makefiles-build,代码行数:22,代码来源:xmlParser.cpp

示例8: ApplyDelta

void DeltaApplyEngine::ApplyDelta(XID_DOMDocument *IncDeltaDoc, int backwardNumber) {
    
	DOMNode* deltaRoot = IncDeltaDoc->getDocumentElement();  // <delta_unit>
	DOMNode* deltaElement ;
		for ( deltaElement = deltaRoot->getLastChild(); backwardNumber > 0;  deltaElement = deltaElement->getPreviousSibling(), backwardNumber-- ) {
                  DOMImplementation* impl =  DOMImplementationRegistry::getDOMImplementation(gLS);
                  DOMDocument* backwardDeltaDoc = impl->createDocument(0, XMLString::transcode(""),0);
                
                  //DOMDocument* backwardDeltaDoc = DOMDocument::createDocument();
                  DOMNode* backwardDeltaElement = XyDelta::ReverseDelta(backwardDeltaDoc, deltaElement);			
			ApplyDeltaElement(backwardDeltaElement);
		}
	
}
开发者ID:alon,项目名称:xydiff,代码行数:14,代码来源:DeltaApply.cpp


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