本文整理汇总了C++中DOM_Node::isNull方法的典型用法代码示例。如果您正苦于以下问题:C++ DOM_Node::isNull方法的具体用法?C++ DOM_Node::isNull怎么用?C++ DOM_Node::isNull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DOM_Node
的用法示例。
在下文中一共展示了DOM_Node::isNull方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: nextNode
DOM_Node TreeWalkerImpl::nextNode () {
DOM_Node result;
if (fCurrentNode.isNull()) return result;
result = getFirstChild(fCurrentNode);
if (! result.isNull()) {
fCurrentNode = result;
return result;
}
result = getNextSibling(fCurrentNode);
if (! result.isNull()) {
fCurrentNode = result;
return result;
}
// return parent's 1st sibling.
DOM_Node parent = getParentNode(fCurrentNode);
while (! parent.isNull()) {
result = getNextSibling(parent);
if (! result.isNull()) {
fCurrentNode = result;
return result;
} else {
parent = getParentNode(parent);
}
}
// end , return null
return result;
}
示例2: previousNode
DOM_Node TreeWalkerImpl::previousNode () {
DOM_Node result;
if (fCurrentNode.isNull()) return result;
// get sibling
result = getPreviousSibling(fCurrentNode);
if (result.isNull()) {
result = getParentNode(fCurrentNode);
if (! result.isNull()) {
fCurrentNode = result;
return fCurrentNode;
}
return result;
}
// get the lastChild of result.
DOM_Node lastChild = getLastChild(result);
// if there is a lastChild which passes filters return it.
if (! lastChild.isNull()) {
fCurrentNode = lastChild;
return fCurrentNode;
}
// otherwise return the previous sibling.
if (! result.isNull()) {
fCurrentNode = result;
return fCurrentNode;
}
// otherwise return null.
return result;
}
示例3: getParentNode
DOM_Node TreeWalkerImpl::getParentNode (DOM_Node node) {
DOM_Node result;
if (node.isNull() || node == fRoot) return result;
DOM_Node newNode = node.getParentNode();
if (newNode.isNull()) return result;
short accept = acceptNode(newNode);
if (accept == DOM_NodeFilter::FILTER_ACCEPT)
return newNode;
return getParentNode(newNode);
}
示例4: getFirstChild
DOM_Node TreeWalkerImpl::getFirstChild (DOM_Node node) {
DOM_Node result;
if (node.isNull()) return result;
DOM_Node newNode = node.getFirstChild();
if (newNode.isNull()) return result;
short accept = acceptNode(newNode);
if (accept == DOM_NodeFilter::FILTER_ACCEPT)
return newNode;
else
if (accept == DOM_NodeFilter::FILTER_SKIP
&& newNode.hasChildNodes())
{
return getFirstChild(newNode);
}
return getNextSibling(newNode);
}
示例5: nextSibling
DOM_Node TreeWalkerImpl::nextSibling () {
DOM_Node result;
if (fCurrentNode.isNull()) return result;
DOM_Node node = getNextSibling(fCurrentNode);
if (! node.isNull()) {
fCurrentNode = node;
}
return node;
}
示例6: lastChild
/** Return the last child Node from the current node,
* after applying filter, whatToshow.
* If result is not null, set the current Node.
*/
DOM_Node TreeWalkerImpl::lastChild () {
DOM_Node result;
if (fCurrentNode.isNull()) return result;
DOM_Node node = getLastChild(fCurrentNode);
if (! node.isNull()) {
fCurrentNode = node;
}
return node;
}
示例7: getNextSibling
DOM_Node TreeWalkerImpl::getNextSibling (DOM_Node node) {
DOM_Node result;
if (node.isNull() || node == fRoot) return result;
DOM_Node newNode = node.getNextSibling();
if (newNode.isNull()) {
newNode = node.getParentNode();
if (newNode.isNull() || node == fRoot) return result;
short parentAccept = acceptNode(newNode);
if (parentAccept == DOM_NodeFilter::FILTER_SKIP) {
return getNextSibling(newNode);
}
return result;
}
short accept = acceptNode(newNode);
if (accept == DOM_NodeFilter::FILTER_ACCEPT)
return newNode;
else
if (accept == DOM_NodeFilter::FILTER_SKIP) {
DOM_Node fChild = getFirstChild(newNode);
if (fChild.isNull()) {
return getNextSibling(newNode);
}
return fChild;
}
return getNextSibling(newNode);
}