-
Notifications
You must be signed in to change notification settings - Fork 7
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
tighten the XSD #279
Comments
Thanks, @VladimirAlexiev for improving the assertion and make it concise but needs a bit of correction to make it work. Regarding "negated assert" I tried following and it worked.
report - triggers when the condition evaluates to true above is POC of what's all possible with Schematron |
@dakbhavesh Isn't |
I tried |
@RalphTro @CraigRe who are the main devs of the XSD?
The XSD allows various empty lists and empty strings, and I don't see the rationale for this.
@dakbhavesh compensates this in #255 using Schematron.
But when it comes to single fields, it's better to tighten the XSD rather than defer to Schematron. Eg:
epcList
is required but can be empty, why? This can be fixed by changing minOccurs as follows:epc
can be the empty string, why? Add a minLength facet in the code below:Consider switching to RNC? (this idea was canceled quickly)
https://balisage.net/Proceedings/vol7/html/Lee01/BalisageVol7-Lee01.html example "equivalent schema in XSD using Annotations instead of comments" shows how much nicer is RNC compared to XSD, and #276 asks: is there any chance the group could adopt RNC as XML master schema?
@dakbhavesh:
You can express
(epcList and epcList/epc)
more simply asepcList/epc
: you cannot reach the inner element if the outer element is missing.About
string-length(epcList/epc) > 0
: think this checks oneepc
not necessarily all. I think you have to do something like this:epclist/epc and count(epclist/epc)=count(epclist/epc[string-length()>0])
epclist/epc=""
The text was updated successfully, but these errors were encountered: