I would like to know is there any way to generate xml schema from a c string by using stander c++? In my current application there is a server which sends comma separated string by a socket. That is cumbersome to parse date. I would like to extend this to convert this string into a standard XML format. So that I could easily parse data from client side.
c string:-
Temperature,low:20,high:30,current:24
xml:-
<temperature>
<low>20</low>
<high>30</high>
<current>24</current>
</temperature>
Please provide some link or example to study more. Thanks!
Basically you have two separate steps:
For Step 1. I would suggest using some regular expression library, e.g. Boost.Regex.
As soon as you have the information parsed, you can simply write the XML into a string using standard streams like
and use the resulting string with
s.str().