source: TI02-CSML/trunk/csml/Examples/Parsing/basictest.py @ 3294

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI02-CSML/trunk/csml/Examples/Parsing/basictest.py@3294
Revision 3294, 589 bytes checked in by domlowe, 13 years ago (diff)

updating basictest.py

RevLine 
[3294]1"""Test for CSML parsing code
[2049]2"""
[3294]3
[2049]4import csml
5
[3294]6#Name of test file
7f='example.xml'
[2049]8
[3294]9#Create empty dataset object and parse the file into it.
10#This creates a new CSML document string from the CSML objects in memory.
11dataset=csml.parser.Dataset()
12dataset.parse(f)
[2049]13
14
[3294]15#Output the CSML from the dataset object as a string.
16#Hopefully the CSML output should be the same as the CSML it read in:
17csmldoc = dataset.toXML()
[2049]18
19#Tidy up and print the CSML document:
20strCSML=csml.parser_extra.PrettyPrint(csmldoc)
21strCSML=csml.parser_extra.removeInlineNS(strCSML)
22print strCSML
23
Note: See TracBrowser for help on using the repository browser.