def print_release_link(rnode): verbose = 0 r_path = rnode.getAttribute('path') rr = release.load_path(r_path) print '' print rr.getName() print rr.getPath() print '' if verbose: print "formats:" formats = xpath.Evaluate("child::format",rnode) for f in formats: print " ", f.getAttribute('name') print "mbIDs:" mbids = xpath.Evaluate("child::mbid",rnode) for f in mbids: print " ", my_xml.node_text(f)
def print_catalog(cat): release_links = xpath.Evaluate('child::release_link',cat.doc.documentElement) for rlink in release_links: path = rlink.getAttribute('path') r = release.load_path(path) print r.getName()