示例#1
0
 //--------------------------------------------------
 //--------------------------------------------------
 XML::Node* GetFirstChildElement(const XML::Node* in_node, const std::string& in_name)
 {
     const s8* nameData = nullptr;
     u32 nameSize = in_name.length();
     if (nameSize > 0)
     {
         nameData = in_name.c_str();
     }
     
     XML::Node* child = in_node->first_node(nameData, nameSize);
     if (child != nullptr && child->type() == rapidxml::node_type::node_element)
     {
         return child;
     }
     else if (child != nullptr)
     {
         XML::Node* sibling = child;
         do
         {
             sibling = sibling->next_sibling(nameData, nameSize);
         }
         while(sibling != nullptr && sibling->type() != rapidxml::node_type::node_element);
         return sibling;
     }
     
     return nullptr;
 }
示例#2
0
 //--------------------------------------------------
 //--------------------------------------------------
 XML::Node* GetNextSiblingElement(const XML::Node* in_node, const std::string& in_name)
 {
     const s8* nameData = nullptr;
     u32 nameSize = in_name.length();
     if (nameSize > 0)
     {
         nameData = in_name.c_str();
     }
     
     XML::Node* sibling = in_node->next_sibling(nameData, nameSize);
     while (sibling != nullptr && sibling->type() != rapidxml::node_type::node_element)
     {
         sibling = sibling->next_sibling(nameData, nameSize);
     }
     return sibling;
 }