| 140 | |
| 141 | |
| 142 | Element* Document::documentElement() const |
| 143 | { |
| 144 | // Skip non-element nodes before the document element |
| 145 | Node* pCur = firstChild(); |
| 146 | while (pCur) |
| 147 | { |
| 148 | if (dynamic_cast<Element*>(pCur)) |
| 149 | return static_cast<Element*>(pCur); |
| 150 | pCur = pCur->nextSibling(); |
| 151 | } |
| 152 | return 0; |
| 153 | } |
| 154 | |
| 155 | |
| 156 | Element* Document::createElement(const XMLString& tagName) const |