Stores XML representation of a Jython variable or data structure in XML format in a file.
xml_save(filename,v,attswitch='on')
xml_save stores a Jython variable in plain text XML format into the file specified by the user.
The Jython variable v can be any of the types supported by xml_format.
filename full filename (including path and extension).
v Jython variable or data structure to store in file.
attswitch optional, 'on' stores XML type attributes
idx, size, type (default),
'off' doesn't store XML type attributes.
This example saves a Jython dictionary as XML in a file at a given location.
from gdxml import *
v = {}
v['name'] = 'Google'
v['url'] = 'http://www.google.com'
v['rating'] = 5
v['description'] = 'Great search functionality for the web'
xml_save('c:/data/myfavourite.xml', v)
xml_save uses xml_format and then stores the resulting XML string in the file with the given filename.
xml_format, xml_parse, xml_load
Copyright © 2005, The Geodise Project, University of Southampton