Changeset 4036 for TI02-CSML


Ignore:
Timestamp:
02/07/08 16:47:03 (11 years ago)
Author:
cbyrom
Message:

Extend the molesReadWrite toXML() method to allow suppression of namespace
values when creating output.

File:
1 edited

Legend:

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

    r4034 r4036  
    244244        molesElement.__init__(self, **kwargs) 
    245245         
    246     def toXML(self): 
     246    def toXML(self, suppressNameSpace=False): 
    247247        # ensure that the schema is avaiable locally - if not extract from egg 
    248248        self.molesSchema = 'ndgmetadata1.3.xsd' 
     
    250250        self.schema = xmlSchema(self.molesSchema) 
    251251        molesFrag=ET.Element('dgMetadata') 
    252         molesFrag.attrib['xmlns']='http://ndg.nerc.ac.uk/moles' 
     252        if not suppressNameSpace: 
     253            molesFrag.attrib['xmlns']='http://ndg.nerc.ac.uk/moles' 
    253254        molesElement.toXML(self,molesFrag,schema=self.schema) 
    254255        return molesFrag 
Note: See TracChangeset for help on using the changeset viewer.