Howto:Create animation XML files from Nasal
Jump to navigation
Jump to search
This article is a stub. You can help the wiki by expanding it. |
Objective: Use Nasal scripting to dynamically create an XML file by using the setprop() API call to set up your XML file's PropertyList-encoded structure and then writing the result to the file system using the write_properties() wrapper.
Getting started
The following piece of Nasal creates a new XML file:
var location= "/temp/test/foo";
var filename="test.xml";
setprop(location, "hello world");
write_properties(filename, location);
The created output is:
<?xml version="1.0"?>
<PropertyList>
<temp>
<test>
<foo>hello world</foo>
</test>
</temp>