Uploaded December 2019 | Updated September 2026, 1 week ago
This video explains how to parse a simple XML document using the ESP32 and the Arduino core. In this video we will use the TinyXML-2 library.
Note: On the video, I've mistakenly mentioned that the output of the FirstChildElement method is a XMLDocument object pointer, but it is a XMLElement object pointer.
Tested on an ESP32 FireBeetle board from DFRobot: dfrobot.com/product-1590.html
TinyXML2 GitHub page: github.com/leethomason/tinyxml2
TinyXML-2 Documentation page: leethomason.github.io/tinyxml2/index.html
Parse method documentation: leethomason.github.io/tinyxml2/classtinyxml2_1_1_x_m_l_document.html#a1819bd34f540a7304c105a6232d25a1f
FirstChild method documentation: leethomason.github.io/tinyxml2/classtinyxml2_1_1_x_m_l_node.html#ae7dc225e1018cdd685f7563593a1fe08
FirstChildElement method documentation: leethomason.github.io/tinyxml2/classtinyxml2_1_1_x_m_l_node.html#a1795a35852dc8aae877cc8ded986e59b
QueryIntText method documentation: leethomason.github.io/tinyxml2/classtinyxml2_1_1_x_m_l_element.html#a926357996bef633cb736e1a558419632
In case of error, the QueryIntText method returns:
- XML_CAN_NOT_CONVERT_TEXT: if the text cannot be converted to the requested type (int)
- XML_NO_TEXT_NODE if there is no child text to query.
This video explains how to parse a simple XML document using the ESP32 and the Arduino core. In this video we will use the TinyXML-2 library.
Note: On the video, I've mistakenly mentioned that the output of the FirstChildElement method is a XMLDocument object pointer, but it is a XMLElement object pointer.
Tested on an ESP32 FireBeetle board from DFRobot: dfrobot.com/product-1590.html
TinyXML2 GitHub page: github.com/leethomason/tinyxml2
TinyXML-2 Documentation page: leethomason.github.io/tinyxml2/index.html
Parse method documentation: leethomason.github.io/tinyxml2/classtinyxml2_1_1_x_m_l_document.html#a1819bd34f540a7304c105a6232d25a1f
FirstChild method documentation: leethomason.github.io/tinyxml2/classtinyxml2_1_1_x_m_l_node.html#ae7dc225e1018cdd685f7563593a1fe08
FirstChildElement method documentation: leethomason.github.io/tinyxml2/classtinyxml2_1_1_x_m_l_node.html#a1795a35852dc8aae877cc8ded986e59b
QueryIntText method documentation: leethomason.github.io/tinyxml2/classtinyxml2_1_1_x_m_l_element.html#a926357996bef633cb736e1a558419632
In case of error, the QueryIntText method returns:
- XML_CAN_NOT_CONVERT_TEXT: if the text cannot be converted to the requested type (int)
- XML_NO_TEXT_NODE if there is no child text to query.










