[x3d-public] Major stumbling block in X3DJSAIL. NMTOKEN regexp

Don Brutzman brutzman at nps.edu
Thu Jan 26 10:41:20 PST 2017


Thanks John.

Please advise, what are some example NMTOKEN values you find failing?  Presumably DEF values...

BTW this regex is pretty simple and is based on

	X3D XML encoding, 4.3.4 DEF and USE attribute syntax
	http://www.web3d.org/documents/specifications/19776-1/V3.3/Part01/concepts.html#DEFAndUSEAttributeSyntax

	Extensible Markup Language (XML) 1.0 (Fifth Edition), 3.3.1 Attribute Types (specifically NMTOKEN)
	https://www.w3.org/TR/REC-xml/#sec-attribute-types
	and
	3.3.3 Attribute-Value Normalization
	https://www.w3.org/TR/REC-xml/#AVNormalize	

	X3D Classic VRML encoding, Annex A Grammar, A.2 General
	http://www.web3d.org/documents/specifications/19776-2/V3.3/Part02/grammar.html#General
=======
nodeStatement ::=
     node |
     DEF nodeNameId node |
     USE nodeNameId ;

nodeNameId ::=
     Id ;

Id ::=
     IdFirstChar |
     IdFirstChar IdRestChars ;
IdFirstChar ::=
     Any ISO-10646 character encoded using UTF-8 except: 0x30-0x3a, 0x0-0x20, 0x22, 0x23, 0x27, 0x2b, 0x2c, 0x2d, 0x2e, 0x5b, 0x5c, 0x5d, 0x7b, 0x7d, 0x7f ;
IdRestChars ::=
     Any number of ISO-10646 characters except: 0x0-0x20, 0x22, 0x23, 0x27, 0x2c, 0x2e, 0x3a, 0x5b, 0x5c, 0x5d, 0x7b, 0x7d, 0x7f ;
========

and
	X3D Scene Authoring Hints: Naming Conventions
	http://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#NamingConventions


Yes getting the most precise regex is important.  It can go in schema, which is reflected in X3DJSAIL, and also will help us improve the following preliminary-draft documentation.  Improvements welcome.

	X3D Regular Expressions
	http://www.web3d.org/specifications/X3dRegularExpressions.html

If we find that the ClassicVRML constraints don't match XML NMTOKEN constraints, then we will need to align them or else content won't be portable.  In addition to X3D portability, any mismatches would negatively impact internationalization (i18n) and canonicalization/signature/encryption of X3D.


On 1/26/2017 1:18 AM, yottzumm at gmail.com wrote:
> These regular expression matches are causing a major stumbling block in the debugging of X3DJSAIL.   They should be replaced or fixed with something from X3D Schema (something which matches the standard).  There are more files which pass running in Java, but they fail when the files are diffed against the original.  I will work on creating a report on the diffs at some point (I may have to fix my Java serializer), but for now, we can work on this.
>
> CreateX3dSceneAccessInterfaceJava.xslt:17409:                   !newValue.matches("[a-zA-Z_][a-zA-Z_0-9]*")) // NMTOKEN character regex check
>
> CreateX3dSceneAccessInterfaceJava.xslt:17427:                   !newValue.matches("[a-zA-Z_][a-zA-Z_0-9]*")) // NMTOKEN character regex check
>
> CreateX3dSceneAccessInterfaceJava.xslt:18339:                   !newValue.matches("[a-zA-Z_][a-zA-Z_0-9]*")) // NMTOKEN character regex check</xsl:text>

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