Changeset 1331

Show
Ignore:
Timestamp:
07/11/08 15:50:54 (2 months ago)
Author:
thomase
Message:

cleaner code for error messages on IDless mods elements

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • BADataMunger/trunk/modsmixer.py

    r949 r1331  
    105105                    snode.attrib['ID'] = lnode.attrib['ID'] 
    106106                else: 
    107                     logging.warning("no ID attribute on mods element %s of %s" % (len(lnode.xpath("previous::*[local-name()='mods']")), len(lnode.xpath("//*[local-name()='mods']")))) 
     107                    prevnodes = lnode.xpath("preceding::*[local-name()='mods']") 
     108                    totnodes = lnode.xpath("//*[local-name()='mods']") 
     109                    logging.warning("no ID attribute on mods element %s of %s" % (len(prevnodes), len(totnodes))) 
    108110 
    109111                # proper title type attributes