cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

create & Write data into XML file

RockLala
11-Garnet

create & Write data into XML file

hello everyone 

I want to create xml file on button click and write some content into this. which API do i need to used how to used it. could you please help me into this. 

 

Thanks in advance 

2 REPLIES 2
vxavier
13-Aquamarine
(To:RockLala)

The FileRepository thing template has a service called SaveXML. The input is the path and the content.

 

For write and edit XML files, here is a post explaining it:

 

Create XML

 

Here it is a example: 

 

var languages = <languages type="dynamic">
   <lang>JavaScript</lang>
   <lang>Python</lang>
</languages>;


var params = {
	path: "/theXml.xml" /* STRING */,
	content: languages /* XML */
};

// no return
Things["RepositoryThing"].SaveXML(params);

 

Hope it helps =)

mgoel
17-Peridot
(To:RockLala)

Hi @RockLala

 

Could you please confirm if your issue has been resolved. If yes, Please mark this post as accept as solution for the future reference, So that other can take benefit in case of same question.

 

Redards- Mohit Goel  

Top Tags