// Child creation void CXmlElement::createChild(CXmlElement &childElement, const string &strType) { #ifdef LIBXML_TREE_ENABLED xmlNodePtr pChildNode = xmlNewChild(_pXmlElement, nullptr, BAD_CAST strType.c_str(), nullptr); childElement.setXmlElement(pChildNode); #endif }
bool CXmlElement::getParentElement(CXmlElement &parentElement) const { _xmlNode *pXmlNode = _pXmlElement->parent; if (pXmlNode->type == XML_ELEMENT_NODE) { parentElement.setXmlElement(pXmlNode); return true; } return false; }
bool CXmlElement::CChildIterator::next(CXmlElement &xmlChildElement) { while (_pCurNode) { if (_pCurNode->type == XML_ELEMENT_NODE) { xmlChildElement.setXmlElement(_pCurNode); _pCurNode = _pCurNode->next; return true; } _pCurNode = _pCurNode->next; } return false; }
void CXmlDocSource::getRootElement(CXmlElement &xmlRootElement) const { xmlRootElement.setXmlElement(_pRootNode); }