-
Notifications
You must be signed in to change notification settings - Fork 4
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
Restrict float attribute values where possible to allow for better xml-validation. #62
Comments
Based on the discussion in the meeting 2020-12-13 the ROTATION can have valid negative values. |
Limiting values to positive will break backward compatibility so this can be changed in ALTO 5.0 release at the earliest. |
I agree that limiting WIDTH, HEIGHT, HPOS, VPOS to positive values would make sense. From my understanding, HPOS and VPOS are always in relation to the entire page, so values outside of the page's real dimensions (e.g. (-100, -100)) should not exist. However, for the ParagraphStyle LEFT and RIGHT indent, I am not sure if positive values should be enforced, because the indent value is relative to the paragraph and even if it is not a good practice, it would still be valid in the same way that negative values (or positions, margins and paddings) in HTML are accepted. |
Maybe XSD 1.1 schema asserts could be used to create validations that rely on other element values: PrintSpace can't be larger than Page etc. |
A new branch added (issue-62) to make changes for this topic. There are several things to discuss, since the only option to completely implement this is to use xsd 1.1 (to restrict not only some values to be positive, but also restrictions like height of a block + vpos < page height). On the new branch, there are just fie restrictions on Page level, but there is much more to be done. One topic to clarify is if we want to go with this solution and enforce validation with xsd 1.1 processors. Or if we implement only simple restrictions (positive values, no relative restrictions)? If we go for full solution, probably when switching to 5.0 would be a good moment |
For example ALTO schema allows negative float values in attributes like WIDTH, HEIGHT, HPOS, VPOS where values should be positive.
Validating against schema doesn't catch documents where software has created nonsensical values.
xsd:float is used in following attributes:
PageType
-> values should be always positive integers?
-> values should be limited to 0-100 floats?
ParagraphStyle
BlockType
-> Limit to 0-360 float?
SPType
StringType
PageSpaceType
EllipseType
An ellipse shape. HPOS and VPOS describe the center of the ellipse. HLENGTH and VLENGTH are the width and height of the described ellipse.
The attribute ROTATION tells the rotation of the e.g. text or illustration within the block. The value is in degrees counterclockwise.
-> Limit to 0-360 float?
CircleType
A circle shape. HPOS and VPOS describe the center of the circle.
formattingAttributeGroup
HYP
TextLine
GlyphType
The text was updated successfully, but these errors were encountered: