xml_save

Stores XML representation of a Jython variable or data structure in XML format in a file.

 

Syntax

xml_save(filename,v,attswitch='on')

 

Description

xml_save stores a Jython variable in plain text XML format into the file specified by the user.

 

Input Arguments

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.

 

Examples

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)

 

Notes

xml_save uses xml_format and then stores the resulting XML string in the file with the given filename.

 

See also

xml_format, xml_parse, xml_load




xml_parse

contents

utilities

Copyright © 2005, The Geodise Project, University of Southampton