Changeset 12:b209ea521e96


Ignore:
Timestamp:
24.01.2010 22:17:53 (7 years ago)
Author:
andre.hagenbruch@rub.de
Branch:
default
Message:

Preparations for feed process refactoring.

Files:
3 added
1 edited

Legend:

Unmodified
Added
Removed
  • mods_util.py

    r0 r12  
    1818 
    1919from lxml import etree 
     20from lxml import objectify 
     21 
    2022import uuid, datetime 
     23 
     24def objectify_records(mods_file): 
     25        records = [] 
     26        mc = etree.parse(mods_file) 
     27        collection = mc.findall('.//{%s}mods' % NS) 
     28 
     29        for record in collection: 
     30                r = etree.tostring(record) 
     31                records.append(objectify.fromstring(r)) 
     32 
     33        return records 
    2134 
    2235def mods(ename, val, **attr): 
Note: See TracChangeset for help on using the changeset viewer.