Changeset 1838 for TI02-CSML


Ignore:
Timestamp:
08/12/06 09:38:00 (13 years ago)
Author:
domlowe
Message:

moved xmlSchema() instantiation from init to toXML method

Location:
TI02-CSML/trunk/csml2MolesStuff
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TI02-CSML/trunk/csml2MolesStuff/csml2moles.py

    r1694 r1838  
    217217    
    218218    #produce XML again (round trip) 
    219     #tree=cElementTree.ElementTree(file='molesout.xml') 
    220     #dgMeta=MRW.dgMetadata() 
    221     #dgMeta.fromXML(tree.getroot()) 
    222     #molestree=dgMeta.toXML() 
    223     #moles=csml.parser_extra.PrettyPrint(molestree) 
    224     #print '\n \n \n AFTER PARSING' 
    225     #print moles    
    226  
     219    tree=cElementTree.ElementTree(file='molesout.xml') 
     220    dgMeta=MRW.dgMetadata() 
     221    dgMeta.fromXML(tree.getroot()) 
     222    molestree=dgMeta.toXML() 
     223    moles=csml.parser_extra.PrettyPrint(molestree) 
     224    print '\n \n \n AFTER PARSING' 
     225    print moles    
     226    print dir(molestree) 
    227227    
    228228if __name__=='__main__': 
  • TI02-CSML/trunk/csml2MolesStuff/molesReadWrite.py

    r1829 r1838  
    140140class dgMetadata(molesElement):     
    141141    def __init__(self, **kwargs): 
    142         self.schema = xmlSchema('ndgmetadata1.3.xsd') 
    143142        molesElement.__init__(self, **kwargs) 
    144143         
    145144    def toXML(self): 
     145        self.schema = xmlSchema('ndgmetadata1.3.xsd') 
    146146        molesFrag=ET.Element('dgMetadata') 
    147147        molesElement.toXML(self,molesFrag,schema=self.schema) 
Note: See TracChangeset for help on using the changeset viewer.