def write_properties_core(properties):
 root = Element('cp:coreProperties', {'xmlns:cp': NAMESPACES['cp'], 'xmlns:xsi': NAMESPACES['xsi'], 'xmlns:dc': NAMESPACES['dc'], 'xmlns:dcterms': NAMESPACES['dcterms'], 'xmlns:dcmitype': NAMESPACES['dcmitype']})
 SubElement(root, 'dc:creator').text = properties.creator
 SubElement(root, 'cp:lastModifiedBy').text = properties.last_modified_by
 SubElement(root, 'dcterms:created', {'xsi:type': 'dcterms:W3CDTF'}).text = datetime_to_W3CDTF(properties.created)
 SubElement(root, 'dcterms:modified', {'xsi:type': 'dcterms:W3CDTF'}).text = datetime_to_W3CDTF(properties.modified)
 return get_document_content(root)

def write_properties_core ( properties ) : root = Element ( 'cp:coreProperties' , { 'xmlns:cp' : NAMESPACES [ 'cp' ] , 'xmlns:xsi' : NAMESPACES [ 'xsi' ] , 'xmlns:dc' : NAMESPACES [ 'dc' ] , 'xmlns:dcterms' : NAMESPACES [ 'dcterms' ] , 'xmlns:dcmitype' : NAMESPACES [ 'dcmitype' ] } ) SubElement ( root , 'dc:creator' ) . text = properties . creator SubElement ( root , 'cp:lastModifiedBy' ) . text = properties . last_modified_by SubElement ( root , 'dcterms:created' , { 'xsi:type' : 'dcterms:W3CDTF' } ) . text = datetime_to_W3CDTF ( properties . created ) SubElement ( root , 'dcterms:modified' , { 'xsi:type' : 'dcterms:W3CDTF' } ) . text = datetime_to_W3CDTF ( properties . modified ) return get_document_content ( root )
write the core properties to xml .