c++ - How to add more details inside the xml tags generated by cmarkup? -


i generating sample.xml file using cmarkup parser follows:

cmarkup xml; xml.addelem( "order" ); xml.intoelem(); xml.addelem( "item" ); xml.intoelem(); xml.addelem( "sn", "132487a-j" ); xml.addelem( "name", "crank casing" ); xml.addelem( "qty", "1" ); 

following generated sample.xml file:

<order> <item> <sn>132487a-j</sn> <name>crank casing</name> <qty>1</qty> </item> </order> 

now, want add

<?xml version="1.0" encoding="utf-8"?>  

on top of generated sample.xml , want add line inside "item" tag as:

... <item> <person age="12" passed="yes">alive</person> .... </item> 

i searched various methods in cmarkup achieve not getting clearity there. so, please suggest me how can add above mentioned 2 lines in xml.

xml.setdoc("<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n"); .... xml.addelem("person", "alive"); xml.setattrib("age", "12"); xml.setattrib("passed", "yes"); 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -