-
Notifications
You must be signed in to change notification settings - Fork 23
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
Implement Object checking for allowed children #49
Comments
Is there any updates on this? I realise that ensuring the validity agains a custom schema is a complex problem. But one more little step in addition to checking for allowed children would be to ensure that the children are coming in the allowed order. |
I'm increasingly not inclined to implement this, for a couple reasons. The first is architectural: the customization functionality of libmei is the most complex part of it, conceptually, and I've seen a lot of problems with people who don't understand the relationship between the ODD and the library. Because of the nature of this code (as a library) the only real thing we can do is raise an exception on a failure (since we can't "gracefully recover" from wrong input) so that would add an additional amount of frustration. The second, more practical reason, is things like this it's already implemented in the RelaxNG schema. It's really easy to validate a test set of software against the RelaxNG schema, so it would be duplicating this for no real good reason. You can use Schematron rules to validate things like order within tags. |
I admit I haven't even used the customization functionality, just coming across issues when it would be useful. Yes, you can validate with Schematron after the MEI is exported, but that's a bit too late. Ideal would be if we could write code like this:
and it would still become a valid MEI (i.e. with children in the correct order, |
Yeah, that's not going to happen. There's just way too many possibilities, and would probably just serve to frustrate rather than help. |
I am not sure I understand the problem/question, but it seems to be that fileDesc.addPubStmt( stmt ) Laurent On Fri, Sep 12, 2014 at 4:42 PM, Zoltan Komives [email protected]
|
What I meant is that addTitleStmt would be generated only if titleStmt is On Fri, Sep 12, 2014 at 4:57 PM, Andrew Hankinson [email protected]
|
If you really want to, validation can take place in your own software prior to saving, e.g.,
|
In the generated code, we should use the ODD models to ensure that any children that are being added to an object are allowed by the schema. Currently any object is allowed to be a child of any other object, which doesn't always make sense.
The text was updated successfully, but these errors were encountered: