[x3d-public] X3D regular expression (regex) improvements
Don Brutzman
brutzman at nps.edu
Mon Aug 6 08:36:03 PDT 2018
Much work and progress on X3D Regexes, with support and unit tests for most of the major types.
X3D Regular Expressions (regexes)
http://www.web3d.org/specifications/X3dRegularExpressions.html
Lots of detail provided for Design Considerations and also Whitespace. These improvements are integrated into X3D v4 schema.
Had thought I found a way to detect things like multiple commas and 0 0 0 axis starting an SFRotation value - but this uses "negative lookahead" which is not supported by XML Schema (XSD). It is documented however since other regex engines can use it. In general, regex constructs that are inconsistently implemented across major programming languages are avoided.
Lots of unit tests are provided, see "regex101" online tests accompanying each type. Also FieldObjectTests.java in the X3DJSAIL junit5 tests package has a large number of tests.
X3DJSAIL performs regex testing on each attribute when validating, so I will next perform a thorough set of regression tests on all 3900 examples.
X3D Java Scene Access Interface Library (X3DJSAIL)
http://www.web3d.org/specifications/java/X3DJSAIL.html
X3D Resources: Example Scene Archives for X3D
http://www.web3d.org/x3d/content/examples/X3dResources.html#Examples
Looking ahead:
a. TODO: SF/MFImage and matrix types.
b. Will collect and expose specialty regexes for error detection (for example, floating point numbers with two decimal points).
c. Am thinking we might well define field subtypes for additional authoring support by tools. For example SFInt32NonNegative SFVec3fBoundingBox, SFFloatZeroToOne etc.
This X3D Unified Object Model (X3DUOM) work is all part of
X3D Resources: Quality Assurance (QA)
http://www.web3d.org/x3d/content/examples/X3dResources.html#QualityAssurance
Have fun with X3D validation! 8)
all the best, Don
--
Don Brutzman Naval Postgraduate School, Code USW/Br brutzman at nps.edu
Watkins 270, MOVES Institute, Monterey CA 93943-5000 USA +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman
More information about the x3d-public
mailing list