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

Line 
1"""Test for CSML parsing code
2"""
3
4import csml
5
6#Name of test file
7f='example.xml'
8
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)
13
14
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()
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.