bbc.co.uk

Home
Contacts
 NMLParser - an XML - object serializer for python

Download

The package is:

To run, type:
make run
From the README:
An XML - python object serializer / deserializer.
-------------------------------------------------

To run the test:
	cd src
	python nwtest.py

This reads in the test XML file "test-net.xml" and its
schema "test-net.sch" and populates objects defined
in the nwtest.py file.

The only file needed is the "nmlparser.py" library 
which provides the main methods for:

Reading schema:
	# Read in a schema:-
	netSchema = parseSchemaFile("test-net.sch")
	
Reading XML:
	# Read in a data file:-
	tree = parseXMLFile("test-net.xml", locals(), netSchema)

Writing XML:
	# Write out an object 
	print serializeObject(tree, netSchema)


Files in src/ directory:
	test-net.sch	- defines the classes and fields.
	test-net.xml	- defines an instance XML network
	nmlparser.py    - includes generic parser/generator
	testnw.py       - a short test routine.

The docs/ directory includes versions of the schema format
defined using itself, which may be of reference interest.


Fred Howell
fwh@inf.ed.ac.uk
Oct 2005