| 81 | } |
| 82 | |
| 83 | std::shared_ptr<DOMNode> DOMNode::getFirstChild(const std::string& name) const { |
| 84 | auto child = this->firstChild; |
| 85 | if (!name.empty()) { |
| 86 | for (; child != nullptr; child = child->nextSibling) { |
| 87 | if (child->name != name) { |
| 88 | break; |
| 89 | } |
| 90 | } |
| 91 | } |
| 92 | return child; |
| 93 | } |
| 94 | |
| 95 | std::shared_ptr<DOMNode> DOMNode::getNextSibling(const std::string& name) const { |
| 96 | auto sibling = this->nextSibling; |