Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem: Tree or serialize() required as an arg to validate functions when METSDocument would be a nicer abstraction #41

Open
ross-spencer opened this issue Apr 4, 2018 · 1 comment

Comments

@ross-spencer
Copy link
Contributor

ross-spencer commented Apr 4, 2018

Here, and a few other places we're asked to pass a .tree argument as mets_doc, in this case, to validate the document:

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 ross-spencer changed the title Problem: Tree required as an arg to validate functions when MetsDocument would be a nicer abstraction Problem: Tree or serialize() required as an arg to validate functions when MetsDocument would be a nicer abstraction Apr 4, 2018
@ross-spencer ross-spencer changed the title Problem: Tree or serialize() required as an arg to validate functions when MetsDocument would be a nicer abstraction Problem: Tree or serialize() required as an arg to validate functions when METSDocument would be a nicer abstraction Apr 4, 2018
@jrwdunham
Copy link
Contributor

@ross-spencer I agree. In fact, I think even nicer would be making .validate() an instance method of METSDocument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants