Open ross-spencer opened 6 years ago
Here, and a few other places we're asked to pass a .tree argument as mets_doc, in this case, to validate the document:
.tree
mets_doc
def xsd_validate(mets_doc, xmlschema=METS_XSD_PATH): xmlschema = get_xmlschema(xmlschema, mets_doc) is_valid = xmlschema.validate(mets_doc) error_log = xmlschema.error_log return is_valid, error_log
I wonder if the METSDocument itself wouldn't be a nicer abstraction to be passing around functions such as this when using this utility?
@ross-spencer I agree. In fact, I think even nicer would be making .validate() an instance method of METSDocument.
.validate()
METSDocument
Here, and a few other places we're asked to pass a
.tree
argument asmets_doc
, in this case, to validate the document:I wonder if the METSDocument itself wouldn't be a nicer abstraction to be passing around functions such as this when using this utility?