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

yottzumm at gmail.com yottzumm at gmail.com
Thu Jan 26 11:04:53 PST 2017


www_web3d_org/x3d/content/examples/Basic/development/CameraExamples
Exception in thread "main" org.web3d.x3d.sai.InvalidFieldValueException:  DEF newValue="Camera.SimpleShotsTest" has illegal value, must use a valid name string.^M
        at org.web3d.x3d.java.X3DConcreteNode.setConcreteDEF(X3DConcreteNode.java:143)^M
        at org.web3d.x3d.java.Core.ProtoInstanceObject.setDEF(ProtoInstanceObject.java:417)^M
        at www_web3d_org.x3d.content.examples.Basic.development.CameraExamples.main(CameraExamples.java:1064)^M

meta name: (also setName() in metaObject.java).


www_web3d_org/x3d/content/examples/Basic/ChemicalMarkupLanguage/Digitoxigenin
Exception in thread "main" org.web3d.x3d.sai.InvalidFieldValueException: meta name newValue="CML version" has illegal value, must use a valid name string.^M
        at org.web3d.x3d.java.Core.metaObject.setName(metaObject.java:484)^M
        at www_web3d_org.x3d.content.examples.Basic.ChemicalMarkupLanguage.Digitoxigenin.main(Digitoxigenin.java:104)^M
www_web3d_org/x3d/content/examples/Basic/ChemicalMarkupLanguage/DimethylSulfoxide
Exception in thread "main" org.web3d.x3d.sai.InvalidFieldValueException: meta name newValue="CML version" has illegal value, must use a valid name string.^M
        at org.web3d.x3d.java.Core.metaObject.setName(metaObject.java:484)^M
        at www_web3d_org.x3d.content.examples.Basic.ChemicalMarkupLanguage.DimethylSulfoxide.main(DimethylSulfoxide.java:104)^M
www_web3d_org/x3d/content/examples/Basic/ChemicalMarkupLanguage/Ethanol
Exception in thread "main" org.web3d.x3d.sai.InvalidFieldValueException: meta name newValue="CML version" has illegal value, must use a valid name string.^M
        at org.web3d.x3d.java.Core.metaObject.setName(metaObject.java:484)^M
        at www_web3d_org.x3d.content.examples.Basic.ChemicalMarkupLanguage.Ethanol.main(Ethanol.java:104)^M
www_web3d_org/x3d/content/examples/Basic/ChemicalMarkupLanguage/GlycerolDiacetate
Exception in thread "main" org.web3d.x3d.sai.InvalidFieldValueException: meta name newValue="CML version" has illegal value, must use a valid name string.^M
        at org.web3d.x3d.java.Core.metaObject.setName(metaObject.java:484)^M
        at www_web3d_org.x3d.content.examples.Basic.ChemicalMarkupLanguage.GlycerolDiacetate.main(GlycerolDiacetate.java:104)^M
www_web3d_org/x3d/content/examples/Basic/ChemicalMarkupLanguage/Histamine
Exception in thread "main" org.web3d.x3d.sai.InvalidFieldValueException: meta name newValue="CML version" has illegal value, must use a valid name string.^M
        at org.web3d.x3d.java.Core.metaObject.setName(metaObject.java:484)^M
        at www_web3d_org.x3d.content.examples.Basic.ChemicalMarkupLanguage.Histamine.main(Histamine.java:104)^M
www_web3d_org/x3d/content/examples/Basic/ChemicalMarkupLanguage/Oxytocin
Exception in thread "main" org.web3d.x3d.sai.InvalidFieldValueException: meta name newValue="CML version" has illegal value, must use a valid name string.^M
        at org.web3d.x3d.java.Core.metaObject.setName(metaObject.java:484)^M
        at www_web3d_org.x3d.content.examples.Basic.ChemicalMarkupLanguage.Oxytocin.main(Oxytocin.java:104)^M
www_web3d_org/x3d/content/examples/Basic/ChemicalMarkupLanguage/PyruvicAcid
Exception in thread "main" org.web3d.x3d.sai.InvalidFieldValueException: meta name newValue="CML version" has illegal value, must use a valid name string.^M
        at org.web3d.x3d.java.Core.metaObject.setName(metaObject.java:484)^M
        at www_web3d_org.x3d.content.examples.Basic.ChemicalMarkupLanguage.PyruvicAcid.main(PyruvicAcid.java:104)^M
www_web3d_org/x3d/content/examples/Basic/ChemicalMarkupLanguage/Riboflavin
Exception in thread "main" org.web3d.x3d.sai.InvalidFieldValueException: meta name newValue="CML version" has illegal value, must use a valid name string.^M
        at org.web3d.x3d.java.Core.metaObject.setName(metaObject.java:484)^M
        at www_web3d_org.x3d.content.examples.Basic.ChemicalMarkupLanguage.Riboflavin.main(Riboflavin.java:104)^M
www_web3d_org/x3d/content/examples/Basic/ChemicalMarkupLanguage/SomatoStatin
Exception in thread "main" org.web3d.x3d.sai.InvalidFieldValueException: meta name newValue="CML version" has illegal value, must use a valid name string.^M
        at org.web3d.x3d.java.Core.metaObject.setName(metaObject.java:484)^M
        at www_web3d_org.x3d.content.examples.Basic.ChemicalMarkupLanguage.SomatoStatin.main(SomatoStatin.java:104)^M
www_web3d_org/x3d/content/examples/Basic/ChemicalMarkupLanguage/TartaricAcid
Exception in thread "main" org.web3d.x3d.sai.InvalidFieldValueException: meta name newValue="CML version" has illegal value, must use a valid name string.^M
        at org.web3d.x3d.java.Core.metaObject.setName(metaObject.java:484)^M
        at www_web3d_org.x3d.content.examples.Basic.ChemicalMarkupLanguage.TartaricAcid.main(TartaricAcid.java:104)^M
www_web3d_org/x3d/content/examples/Basic/ChemicalMarkupLanguage/Tetrahydrofuran
Exception in thread "main" org.web3d.x3d.sai.InvalidFieldValueException: meta name newValue="CML version" has illegal value, must use a valid name string.^M
        at org.web3d.x3d.java.Core.metaObject.setName(metaObject.java:484)^M
        at www_web3d_org.x3d.content.examples.Basic.ChemicalMarkupLanguage.Tetrahydrofuran.main(Tetrahydrofuran.java:104)^M
www_web3d_org/x3d/content/examples/Basic/ChemicalMarkupLanguage/TransDCE
Exception in thread "main" org.web3d.x3d.sai.InvalidFieldValueException: meta name newValue="CML version" has illegal value, must use a valid name string.^M
        at org.web3d.x3d.java.Core.metaObject.setName(metaObject.java:484)^M
        at www_web3d_org.x3d.content.examples.Basic.ChemicalMarkupLanguage.TransDCE.main(TransDCE.java:104)^M

(and more)

DEFs

www_web3d_org/x3d/content/examples/Basic/Geospatial/SriCampus
Exception in thread "main" org.web3d.x3d.sai.InvalidFieldValueException:  DEF newValue="LVCS-ORIGIN" has illegal value, must use a valid name string.^M
        at org.web3d.x3d.java.X3DConcreteNode.setConcreteDEF(X3DConcreteNode.java:143)^M
        at org.web3d.x3d.java.Geospatial.GeoOriginObject.setDEF(GeoOriginObject.java:501)^M
        at www_web3d_org.x3d.content.examples.Basic.Geospatial.SriCampus.main(SriCampus.java:140)^M
www_web3d_org/x3d/content/examples/Basic/Geospatial/SriCampus000
Exception in thread "main" org.web3d.x3d.sai.InvalidFieldValueException:  DEF newValue="OBJECT-0-VERTICES" has illegal value, must use a valid name string.^M
        at org.web3d.x3d.java.X3DConcreteNode.setConcreteDEF(X3DConcreteNode.java:143)^M
        at org.web3d.x3d.java.Rendering.CoordinateObject.setDEF(CoordinateObject.java:324)^M
        at www_web3d_org.x3d.content.examples.Basic.Geospatial.SriCampus000.main(SriCampus000.java:147)^M
www_web3d_org/x3d/content/examples/Basic/Geospatial/SriCampus001
Exception in thread "main" org.web3d.x3d.sai.InvalidFieldValueException:  DEF newValue="OBJECT-1-VERTICES" has illegal value, must use a valid name string.^M
        at org.web3d.x3d.java.X3DConcreteNode.setConcreteDEF(X3DConcreteNode.java:143)^M
        at org.web3d.x3d.java.Rendering.CoordinateObject.setDEF(CoordinateObject.java:324)^M
        at www_web3d_org.x3d.content.examples.Basic.Geospatial.SriCampus001.main(SriCampus001.java:147)^M
www_web3d_org/x3d/content/examples/Basic/Geospatial/SriCampus002
Exception in thread "main" org.web3d.x3d.sai.InvalidFieldValueException:  DEF newValue="OBJECT-2-VERTICES" has illegal value, must use a valid name string.^M
        at org.web3d.x3d.java.X3DConcreteNode.setConcreteDEF(X3DConcreteNode.java:143)^M
        at org.web3d.x3d.java.Rendering.CoordinateObject.setDEF(CoordinateObject.java:324)^M
        at www_web3d_org.x3d.content.examples.Basic.Geospatial.SriCampus002.main(SriCampus002.java:147)^M
www_web3d_org/x3d/content/examples/Basic/Geospatial/SriCampus003
Exception in thread "main" org.web3d.x3d.sai.InvalidFieldValueException:  DEF newValue="OBJECT-3-VERTICES" has illegal value, must use a valid name string.^M
        at org.web3d.x3d.java.X3DConcreteNode.setConcreteDEF(X3DConcreteNode.java:143)^M
        at org.web3d.x3d.java.Rendering.CoordinateObject.setDEF(CoordinateObject.java:324)^M
        at www_web3d_org.x3d.content.examples.Basic.Geospatial.SriCampus003.main(SriCampus003.java:147)^M
www_web3d_org/x3d/content/examples/Basic/Geospatial/SriCampus004
Exception in thread "main" org.web3d.x3d.sai.InvalidFieldValueException:  DEF newValue="OBJECT-4-VERTICES" has illegal value, must use a valid name string.^M
        at org.web3d.x3d.java.X3DConcreteNode.setConcreteDEF(X3DConcreteNode.java:143)^M
        at org.web3d.x3d.java.Rendering.CoordinateObject.setDEF(CoordinateObject.java:324)^M
        at www_web3d_org.x3d.content.examples.Basic.Geospatial.SriCampus004.main(SriCampus004.java:147)^M
www_web3d_org/x3d/content/examples/Basic/Geospatial/SriCampus005
Exception in thread "main" org.web3d.x3d.sai.InvalidFieldValueException:  DEF newValue="OBJECT-5-VERTICES" has illegal value, must use a valid name string.^M
        at org.web3d.x3d.java.X3DConcreteNode.setConcreteDEF(X3DConcreteNode.java:143)^M
        at org.web3d.x3d.java.Rendering.CoordinateObject.setDEF(CoordinateObject.java:324)^M
        at www_web3d_org.x3d.content.examples.Basic.Geospatial.SriCampus005.main(SriCampus005.java:147)^M
www_web3d_org/x3d/content/examples/Basic/Geospatial/SriCampus006
Exception in thread "main" org.web3d.x3d.sai.InvalidFieldValueException:  DEF newValue="OBJECT-6-VERTICES" has illegal value, must use a valid name string.^M
        at org.web3d.x3d.java.X3DConcreteNode.setConcreteDEF(X3DConcreteNode.java:143)^M

(and more)


Sent from Mail for Windows 10

From: Don Brutzman
Sent: Thursday, January 26, 2017 1:41 PM
To: yottzumm at gmail.com; x3d-public at web3d.org; Roy Walmsley
Subject: Re: Major stumbling block in X3DJSAIL. NMTOKEN regexp

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170126/81073022/attachment-0001.html>


More information about the x3d-public mailing list