Quantcast
Viewing all articles
Browse latest Browse all 8068

Wrtiting in XML file

Hi,

I'm trying to write in an XML file but it doesn't work, I cannot change the content of the file Here is the code:

var file = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, 'AppSettings.xml');
var xmlText = file.read().text;
var xmlDoc = Ti.XML.parseString(xmlText);
var doc = xmlDoc.documentElement;
var sNodes = doc.getElementsByTagName("MaxStry");
 
sNodes.item(0).textContent = parseInt(slider.getValue());
 
Ti.XML.serializeToString(sNodes .item(0));
file.write(xmlDoc);
and here is the content of the XML file
<?xml version="1.0" encoding="UTF-8"?>
 
<Resources>
    <MaxStry>50</MaxStry>
</Resources>

Thank you for your help


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>