Changeset 2052 for TI02-CSML/trunk


Ignore:
Timestamp:
25/01/07 12:57:23 (13 years ago)
Author:
domlowe
Message:

Demo code to show creation of PointSeries? feature using CSML V2 parser. Also various small fixes to parser

Location:
TI02-CSML/trunk/csml
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • TI02-CSML/trunk/csml/parser.py

    r2050 r2052  
    6565    def __init__(self, **kwargs): 
    6666        for kw in kwargs: 
    67             self.__dict__[kw]=kwargs[kw] 
     67            self.__setattr__(kw, kwargs[kw]) 
    6868        if not hasattr(self, 'ATTRIBUTES'): 
    6969            self.__dict__['ATTRIBUTES']=[] 
     
    276276class AbstractGML(csElement): 
    277277    def __init__(self, **kwargs): 
    278         a=[GML('id'), GML('description'), GML('name'), GML('MetaDataProperty')] 
     278        a=[GML('id'), GML('name')] 
    279279        addatts(self,a) 
    280280        csElement.__init__(self,**kwargs) 
     281        children={'metaDataProperty':[GML('metaDataProperty'),'csString'],'description':[GML('description'),'csString']} 
     282        addchildren(self,children) 
    281283         
    282284class AssociationAttributeGroup(csElement): 
     
    405407        csElement.__init__(self,**kwargs) 
    406408         
     409 
    407410class RangeSet(AbstractGML,AssociationAttributeGroup,csElement): 
    408411    def __init__(self, **kwargs): 
  • TI02-CSML/trunk/csml/testfiles/basictest.py

    r2038 r2052  
    1515# 1. Test parsing from CSML file 
    1616#tree = ElementTree(file='../XMLInstances/CSMLExample_SuperWrap.xml') 
    17 tree = ElementTree(file='../testfiles/gridseries/testout2.xml') 
     17tree = ElementTree(file='../testfiles/gridseries/testout.xml') 
    1818 
    1919#tree = ElementTree(file='nagridseries.xml') 
Note: See TracChangeset for help on using the changeset viewer.