# Read data from xml file

**URL:** <https://community.particle.io/t/read-data-from-xml-file/26476>\
**Category:** Troubleshooting\
**Created:** [October 11, 2016, 8:30pm UTC](https://community.particle.io/t/read-data-from-xml-file/26476 "2016-10-11T20:30:13Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [October 12, 2016, 10:12am UTC](https://community.particle.io/t/read-data-from-xml-file/26476/2 "2016-10-12T10:12:49Z")

</div>

That’s normal string parsing.  
Scan for `TOT="` and take the portion up to `"`.

I’d use [`strstr()`](http://www.cplusplus.com/reference/cstring/strstr/) for finding the first part and then again `strstr()` or [`strpbrk()`](http://www.cplusplus.com/reference/cstring/strpbrk/).

Or, if you want the numeric value, locate the beginning (as above) and then take the string after `TOT="` into [`atof()`](http://www.cplusplus.com/reference/cstdlib/atof/) or [`strtod()`](http://www.cplusplus.com/reference/cstdlib/strtod/)

Or you use the way shown in the docs 😉  
[https://docs.particle.io/tutorials/topics/webhooks/#the-firmware-1](https://docs.particle.io/tutorials/topics/webhooks/#the-firmware-1)

---

_[View the full topic](https://community.particle.io/t/read-data-from-xml-file/26476)._
