ant -f C:\\x3d-code\\www.web3d.org\\x3d\\stylesheets test.X3DJSAIL
compile.X3DJSAIL.tests:
Compiling org.web3d.x3d.java test classes
Compiling 1 source file to C:\x3d-code\www.web3d.org\x3d\stylesheets\java\classes
test.X3DJSAIL.unitTests:
===========================================
Compiling org.web3d.x3d.java test classes
compile.X3DJSAIL.tests:
Compiling org.web3d.x3d.java test classes
Compiling 1 source file to C:\x3d-code\www.web3d.org\x3d\stylesheets\java\classes
===========================================
ant antfile=java/build.xml target=test.junit5
X3DJSAIL: X3D Java SAI Library.antVersionCheck:
X3DJSAIL: X3D Java SAI Library.test.junit5.directly:
FieldObjectTests start...
FieldObjectTests.fieldObjectInitializationsTest() start...
Preliminary tests...
SFBoolObjectTests...
MFBoolObjectTests...
SFImageObjectTests...
MFImageObjectTests...
SFInt32ObjectTests...
MFInt32ObjectTests...
SFFloatObjectTests...
SFDoubleObjectTests...
SFTimeObjectTests...
MFFloatObjectTests...
MFDoubleObjectTests...
MFTimeObjectTests...
SFVec2fObjectTests...
SFVec2dObjectTests...
MFVec2fObjectTests...
MFVec2dObjectTests...
SFVec3fObjectTests...
SFVec3fBboxSizeObjectTests for bounding box (bbox) constraints...
SFVec3dObjectTests...
MFVec3fObjectTests...
MFVec3dObjectTests...
SFVec4fObjectTests...
SFVec4dObjectTests...
MFVec4fObjectTests...
MFVec4dObjectTests...
SFColorObjectTests...
MFColorObjectTests...
SFColorRGBAObjectTests...
MFColorRGBAObjectTests...
SFRotationObjectTests...
MFRotationObjectTests...
SFMatrix3fObjectTests...
SFMatrix3dObjectTests...
MFMatrix3fObjectTests...
MFMatrix3dObjectTests...
SFMatrix4fObjectTests...
SFMatrix4dObjectTests...
MFMatrix4fObjectTests...
MFMatrix4dObjectTests...
FieldObjectTests.fieldObjectInitializationsTest() complete
FieldObjectTests complete
test.mkdir:
test.X3dToJava.xslt:
org.web3d.x3d.jsail.CommandLine test/arc.x3d -toJava -toFile test/arc.java
Deleting: C:\x3d-code\www.web3d.org\x3d\stylesheets\test\arc.java
parameter: source file arc.x3d filesize 7523 bytes, parsed using Document Object Model (DOM) X3DLoader
parameter: "-toJava" for conversion to Java source code
parameter: "-toFile" "test/arc.java" for result file name root test/arc
convert to Java:
file conversion successful: arc.java (13875 bytes)
compile arc.java source...
Compiling 2 source files to C:\x3d-code\www.web3d.org\x3d\stylesheets\test
test arc execution and self-validation:
Java program "arc" self-validation test results: success
===========================================
org.web3d.x3d.jsail.CommandLine test/flowers4.x3d -toJava -toFile test/flowers4.java
Deleting: C:\x3d-code\www.web3d.org\x3d\stylesheets\test\flowers4.java
parameter: source file flowers4.x3d filesize 9063 bytes, parsed using Document Object Model (DOM) X3DLoader
parameter: "-toJava" for conversion to Java source code
parameter: "-toFile" "test/flowers4.java" for result file name root test/flowers4
convert to Java:
file conversion successful: flowers4.java (16519 bytes)
compile...
Compiling 1 source file to C:\x3d-code\www.web3d.org\x3d\stylesheets\test
test flowers4 execution and self-validation:
Java program "flowers4" self-validation test results: success
===========================================
translation input: test/CameraExamples.x3d
..expected output: test/CameraExamples.java
[meta] name='TODO' content='Schematron rules, backed up by initialize() checks'
compile...
Compiling 1 source file to C:\x3d-code\www.web3d.org\x3d\stylesheets\test
test CameraExamples execution and self-validation:
Java program "CameraExamples" self-validation test results: success
test.X3DJSAIL:
===========================================
Preliminary cleanups
Deleting: C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples\CleatClamp.MeshLab.log.txt
Deleting: C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples\CleatClamp_MeshLabLauncher.MeshLab.log.txt
Could not find file C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples\CleatClamp_MeshLabRoundTrip.log.txt to delete.
Deleting: C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples\CleatClamp_RoundTrip.MeshLab.log.txt
===========================================
ant antfile=java/nashorn/build.xml target=test.nashorn (direct invocation)
X3D Nashorn SAI Library.test.nashorn:
Compile:
Compiling 3 source files to C:\x3d-code\www.web3d.org\x3d\stylesheets\java\classes
Compiling 2 source files to C:\x3d-code\www.web3d.org\x3d\stylesheets\java\classes
Copy:
Copying 1 file to C:\x3d-code\www.web3d.org\x3d\stylesheets\nashorn\examples
Copying C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples\HelloWorldProgramOutput.x3d to C:\x3d-code\www.web3d.org\x3d\stylesheets\nashorn\examples\HelloWorldProgramOutput.x3d
Copying 1 file to C:\x3d-code\www.web3d.org\x3d\stylesheets\nashorn\examples
Copying C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples\HelloWorldProgramOutput.json to C:\x3d-code\www.web3d.org\x3d\stylesheets\nashorn\examples\HelloWorldProgramOutput.json
===========
Run test 1:
org.web3d.x3d.jsail.CommandLine nashorn/examples/HelloWorldProgramOutput.x3d -tojs -toFile nashorn/examples/HelloWorldProgramOutput.Nashorn.js
[Error]  [org.web3d.x3d.jsail.CommandLine] file not found: examples/HelloWorldProgramOutput.x3d
Usage: java [-classpath X3DJSAIL.*.jar] org.web3d.x3d.jsail.CommandLine [sourceModel.x3d | package.path.ProgramName | -help | -page | -resources | -tooltips]
       [-tofile [resultFile.*]] [-properties [propertiesFile]] [-validate]
       [sourceModel.exi -fromEXI] [sourceModel.gz -fromGZIP] [sourceModel.zip -fromZIP]
       [-toX3D | -toXML | -toHTML | -toMarkdown | -toTidy | -toClassicVrml | -toJava | -toJSON | -toVRML97 | -toX3DOM | -toX_ITE | -toEXI | -toGZIP | -toZIP]
===========
Run test 2:
org.web3d.x3d.jsail.CommandLine nashorn/examples/HelloWorldProgramOutput.x3d -toJSON -toFile nashorn/examples/HelloWorldProgramOutput.Java.json
parameter: source file HelloWorldProgramOutput.x3d filesize 21231 bytes, parsed using Document Object Model (DOM) X3DLoader
parameter: "-toJSON" for conversion to JSON encoding
parameter: "-toFile" "nashorn/examples/HelloWorldProgramOutput.Java.json" for result file name root nashorn/examples/HelloWorldProgramOutput.Java
convert to JSON:
Warning: toFileStylesheetConversion(X3dToJson.xslt) is overwriting prior file nashorn/examples/HelloWorldProgramOutput.Java.json
Script DEF=colorTypeConversionScript contains CDATA source-code text, copied as "#sourceText" using "strings" mode
Script DEF=MaterialModulatorScript contains CDATA source-code text, copied as "#sourceText" using "strings" mode
file conversion successful: HelloWorldProgramOutput.Java.json (40022 bytes)
===========
Run test 3:
org.web3d.x3d.jsail.CommandLine nashorn/examples/HelloWorldProgramOutput.x3d -toX3D -toFile nashorn/examples/HelloWorldProgramOutput.Java.x3d
parameter: source file HelloWorldProgramOutput.x3d filesize 21231 bytes, parsed using Document Object Model (DOM) X3DLoader
parameter: "-toX3D" for conversion to X3D encoding
parameter: "-toFile" "nashorn/examples/HelloWorldProgramOutput.Java.x3d" for result file name root nashorn/examples/HelloWorldProgramOutput.Java
convert to X3D:
Warning: nashorn/examples/HelloWorldProgramOutput.Java.x3d does not meet suggested X3D naming conventions, output serialization continuing...
Warning: toFileX3D() is overwriting prior file nashorn/examples/HelloWorldProgramOutput.Java.x3d
file conversion successful: HelloWorldProgramOutput.Java.x3d (21266 bytes)
===========================================
HelloWorldProgramOutput.Java.x3d
1 file(s) have been successfully validated.
1 file(s) have been successfully validated.
matches HelloWorldProgramOutput.x3d: false
===========================================
===========================================
HelloWorldProgramOutput.Java.json
matches HelloWorldProgramOutput.json: true
===========================================
script:
java.io.IOException: nashorn\examples\HelloWorldProgramOutput.Nashorn.js is not a file
Result: 103
===========================================
HelloWorldProgramOutput.Java.x3d
matches HelloWorldProgramOutput.Nashorn.js.new.x3d: false
===========================================
===========================================
HelloWorldProgramOutput.Java.json
matches HelloWorldProgramOutput.Nashorn.js.new.json: false
===========================================
 run test 4
java.io.IOException: nashorn\examples\Nashorn.js is not a file
Result: 103
===========================================
 run test 5
HelloWorldProgramOutput.x3d
matches Nashorn.x3d: false
===========================================
===========================================
HelloWorldProgramOutput.x3d
matches Nashorn0.x3d: false
===========================================
java.io.IOException: nashorn\examples\Json.js is not a file
Result: 103
===========================================
HelloWorldProgramOutput.x3d
matches Json.x3d: false
===========================================
HelloWorldProgramOutput.json
matches Json.json: false
===========================================
helpful invocations for CommandLine debugging
org.web3d.x3d.jsail.CommandLine -help
Usage: java [-classpath X3DJSAIL.*.jar] org.web3d.x3d.jsail.CommandLine [sourceModel.x3d | package.path.ProgramName | -help | -page | -resources | -tooltips]
       [-tofile [resultFile.*]] [-properties [propertiesFile]] [-validate]
       [sourceModel.exi -fromEXI] [sourceModel.gz -fromGZIP] [sourceModel.zip -fromZIP]
       [-toX3D | -toXML | -toHTML | -toMarkdown | -toTidy | -toClassicVrml | -toJava | -toJSON | -toVRML97 | -toX3DOM | -toX_ITE | -toEXI | -toGZIP | -toZIP]
===========================================
org.web3d.x3d.jsail.CommandLine -properties C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/X3DJSAIL.properties
parameter: "-properties" "C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/X3DJSAIL.properties" for properties file name root C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/X3DJSAIL
C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/X3DJSAIL.properties includes 12 properties:
-- listing properties --
XSLT_ENGINE=SAXON
SFImagePixelOutputHexadecimal=true
indentIncrement=2
indentCharacter=SPACE
overwriteExistingFiles=true
stripTrailingZeroes=true
EXI_ENGINE=EXIFICIENT
showDefaultAttributes=false
BLENDER_PATH=
validationExceptionAllowed=false
deleteIntermediateFiles=true
MESHLAB_PATH=
------------------------
C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/X3DJSAIL.properties loading complete.
===========================================
org.web3d.x3d.jsail.MeshLabLauncher -help
Usage: java [-classpath X3DJSAIL.*.jar] org.web3d.x3d.jsail.MeshLabLauncher sourceFile [resultFile] [-convert | -help | -properties fileName.properties | -MESHLAB_PATH directoryPath]
http://www.MeshLab.net
===========================================
Convert CleatClamp.stl to .x3d version ...
org.web3d.x3d.jsail.MeshLabLauncher C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/CleatClamp.stl C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/CleatClamp_MeshLabLauncher.x3d
parameter: source file CleatClamp.stl filesize 542534 bytes
meshlabserver.exe -l C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/CleatClamp_MeshLabLauncher.MeshLab.log.txt -i C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/CleatClamp.stl -o C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/CleatClamp_MeshLabLauncher.x3d
load success: false
===========================================
... and then back to .stl
org.web3d.x3d.jsail.MeshLabLauncher C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/CleatClamp.stl C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/CleatClamp_MeshLabLauncher.stl
parameter: source file CleatClamp.stl filesize 542534 bytes
meshlabserver.exe -l C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/CleatClamp_MeshLabLauncher.MeshLab.log.txt -i C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/CleatClamp.stl -o C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/CleatClamp_MeshLabLauncher.stl
load success: false
===========================================
org.web3d.x3d.jsail.CommandLine C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutput.x3d -toZIP -toFile C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutput.ant.zip
parameter: source file HelloWorldProgramOutput.x3d filesize 21231 bytes, parsed using Document Object Model (DOM) X3DLoader
parameter: "-toZIP" for conversion to compressed ZIP containing model
parameter: "-toFile" "C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutput.ant.zip" for result file name root C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutput.ant
convert to ZIP:
source: C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutput.x3d filesize 21231 bytes
result: HelloWorldProgramOutput.ant.zip filesize 5761 bytes, compression 27.13% of original
===========================================
org.web3d.x3d.jsail.CommandLine C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/flowers4.x3d -toJava -toFile C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/flowers4.java
parameter: source file flowers4.x3d filesize 7176 bytes, parsed using Document Object Model (DOM) X3DLoader
parameter: "-toJava" for conversion to Java source code
parameter: "-toFile" "C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/flowers4.java" for result file name root C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/flowers4
convert to Java:
Warning: toFileStylesheetConversion(X3dToJava.xslt) is overwriting prior file C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/flowers4.java
file conversion successful: flowers4.java (14635 bytes)
compile flowers4.java source...
Compiling 3 source files to C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples
test flowers4 execution and self-validation:
Java program "flowers4" self-validation test results: success
===========================================
org.web3d.x3d.jsail.CommandLine C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/flowers4.x3d -toJSON -toFile C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/flowers4.json
parameter: source file flowers4.x3d filesize 7176 bytes, parsed using Document Object Model (DOM) X3DLoader
parameter: "-toJSON" for conversion to JSON encoding
parameter: "-toFile" "C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/flowers4.json" for result file name root C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/flowers4
convert to JSON:
Warning: toFileStylesheetConversion(X3dToJson.xslt) is overwriting prior file C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/flowers4.json
Script DEF=OrbitScript contains CDATA source-code text, copied as "#sourceText" using "strings" mode
file conversion successful: flowers4.json (12545 bytes)
===========================================
org.web3d.x3d.jsail.CommandLine -toGZIP -toFile C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutput.ant.gz
parameter: source file HelloWorldProgramOutput.x3d filesize 21231 bytes, parsed using Document Object Model (DOM) X3DLoader
parameter: "-toGZIP" for conversion to compressed GZIP containing model
parameter: "-toFile" "C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutput.ant.gz" for result file name root C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutput.ant
convert to GZIP:
source: C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutput.x3d filesize 21231 bytes
result: HelloWorldProgramOutput.ant.gz  filesize 5403 bytes, compression 25.45% of original
===========================================
org.web3d.x3d.jsail.CommandLine -toGZIP -toFile C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutput.ant.gz
parameter: source file HelloWorldProgramOutput.x3d filesize 21231 bytes, parsed using Document Object Model (DOM) X3DLoader
parameter: "-toX3D" for conversion to X3D encoding
parameter: "-toFile" "C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutput_CommandLine.x3d" for result file name root C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutput_CommandLine
convert to X3D:
Warning: toFileX3D() is overwriting prior file C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutput_CommandLine.x3d
file conversion successful: HelloWorldProgramOutput_CommandLine.x3d (21266 bytes)
===========================================
org.web3d.x3d.jsail.CommandLine -toXML -toFile C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutput_CommandLine.xml
parameter: source file HelloWorldProgramOutput.x3d filesize 21231 bytes, parsed using Document Object Model (DOM) X3DLoader
parameter: "-toXML" for conversion to XML encoding
parameter: "-toFile" "C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutput_CommandLine.xml" for result file name root C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutput_CommandLine
convert to XML:
Warning: toFileX3D() is overwriting prior file C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutput_CommandLine.xml
file conversion successful: HelloWorldProgramOutput_CommandLine.xml (21266 bytes)
===========================================
org.web3d.x3d.jsail.CommandLine -toHTML -toFile C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutput_CommandLine.html (pretty print)
parameter: source file HelloWorldProgramOutput.x3d filesize 21231 bytes, parsed using Document Object Model (DOM) X3DLoader
parameter: "-toHTML" for producing .html pretty-print documentation
parameter: "-toFile" "C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutput_CommandLine.html" for result file name root C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutput_CommandLine
convert to .html pretty-print documentation
Warning: toFileStylesheetConversion(X3dExtrusionToSvgViaXslt1.1.xslt) is overwriting prior file C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutput_CommandLine.svg
Warning: toFileStylesheetConversion(X3dToXhtml.xslt) is overwriting prior file C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutput_CommandLine.html
file conversion successful: HelloWorldProgramOutput_CommandLine.html (105934 bytes)
===========================================
org.web3d.x3d.jsail.CommandLine -markdown -toFile C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutput_CommandLine.md
parameter: source file HelloWorldProgramOutput.x3d filesize 21231 bytes, parsed using Document Object Model (DOM) X3DLoader
parameter: "-markdown" for producing .md model meta information markdown
parameter: "-toFile" "C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutput_CommandLine.md" for result file name root C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutput_CommandLine
convert to .md model meta information markdown, include subdirectories in meta links: true
Warning: toFileStylesheetConversion(X3dModelMetaToMarkdown.xslt) is overwriting prior file C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutput_CommandLine.md
file conversion successful: HelloWorldProgramOutput_CommandLine.md (2119 bytes)
## Model Metadata for HelloWorldProgramOutput.x3d

| attribute     | value       |
| ------------: | :---------- |
| `title` | [HelloWorldProgramOutput.x3d](HelloWorldProgramOutput.x3d) |
| `description` | Example HelloWorldProgram creates an X3D model using the X3D Java Scene Access Interface Library (X3DJSAIL) |
| `reference` | [http://www.web3d.org/specifications/java/X3DJSAIL.html](http://www.web3d.org/specifications/java/X3DJSAIL.html) |
| `generator` | HelloWorldProgramOutput.java |
| `created` | 6 September 2016 |
| `modified` | 14 October 2018 |
| `generator` | X3D Java Scene Access Interface Library (X3DJSAIL) |
| `generator` | [http://www.web3d.org/specifications/java/examples/HelloWorldProgram.java](http://www.web3d.org/specifications/java/examples/HelloWorldProgram.java) |
| `generator` | Netbeans http://www.netbeans.org |
| `creator` | Don Brutzman |
| `reference` | [https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/java/examples/HelloWorldProgramOutput.x3d](https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/java/examples/HelloWorldProgramOutput.x3d) |
| `reference` | Console output, ClassicVRML encoding, VRML97 encoding and pretty-print documentation: |
| `reference` | [HelloWorldProgramOutput.txt](HelloWorldProgramOutput.txt) |
| `reference` | [HelloWorldProgramOutput.x3dv](HelloWorldProgramOutput.x3dv) |
| `reference` | [HelloWorldProgramOutput.wrl](HelloWorldProgramOutput.wrl) |
| `reference` | [HelloWorldProgramOutput.html](HelloWorldProgramOutput.html) |
| `X3dValidator` | [https://savage.nps.edu/X3dValidator?url=http://www.web3d.org/specifications/java/examples/HelloWorldProgramOutput.x3d](https://savage.nps.edu/X3dValidator?url=http://www.web3d.org/specifications/java/examples/HelloWorldProgramOutput.x3d) |
| `identifier` | [http://www.web3d.org/specifications/java/examples/HelloWorldProgramOutput.x3d](http://www.web3d.org/specifications/java/examples/HelloWorldProgramOutput.x3d) |
| `license` | [../license.html](../license.html) |
| `SpecialTest` | tested sat: name value cannot contain embedded space character |
===========================================
org.web3d.x3d.jsail.CommandLine -tidy -toFile C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutputTidy.CommandLine.x3d
parameter: source file HelloWorldProgramOutput.x3d filesize 21231 bytes, parsed using Document Object Model (DOM) X3DLoader
parameter: "-tidy" for producing X3D-Tidy cleanup of .x3d
parameter: "-toFile" "C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutputTidy_CommandLine.x3d" for result file name root C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutputTidy_CommandLine
convert to X3D Tidy cleaned-up version
Warning: toFileStylesheetConversion(X3dTidy.xslt) is overwriting prior file C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutputTidy_CommandLine.x3d
*** revision: &lt;meta name='modified' content='14 October 2018'/&gt;
  &lt;Inline DEF='inlineSceneDef'&gt;
    original url='"someOtherScene.x3d"'
*** revision  url='"someOtherScene.x3d" "http://www.web3d.org/specifications/java/examples/someOtherScene.x3d" "someOtherScene.wrl" "http://www.web3d.org/specifications/java/examples/someOtherScene.wrl"'
file conversion successful: HelloWorldProgramOutputTidy_CommandLine.x3d (19873 bytes)
===========================================
compile HelloWorldProgram.java source...
===========================================
test HelloWorldProgram execution and self-validation:
===========================================
===========================================
HelloWorldProgram() Constructor
===========================================
buildModelSceneGraph(); // construct this model, testing many variations
===========================================
showSceneResults();     // test all serializer outputs
ConfigurationProperties.getPropertiesFileName()=X3DJSAIL.properties
X3DJSAIL.properties includes 12 properties:
-- listing properties --
XSLT_ENGINE=SAXON
SFImagePixelOutputHexadecimal=true
indentIncrement=2
indentCharacter=SPACE
overwriteExistingFiles=true
stripTrailingZeroes=true
EXI_ENGINE=EXIFICIENT
showDefaultAttributes=false
BLENDER_PATH=
validationExceptionAllowed=false
deleteIntermediateFiles=true
MESHLAB_PATH=
------------------------
X3DJSAIL.properties loading complete.

HelloWorldProgramOutput.java console output
===========================================
Validation results for this scene graph: 
no errors detected.
===========================================
x3dModel.toStringX3D()

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "http://www.web3d.org/specifications/x3d-3.3.dtd">
<X3D profile='Immersive' version='3.3' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-3.3.xsd'>
    <head>
        <!-- comment #1 -->
        <!-- comment #2 -->
        <!-- comment #3 -->
        <!-- comment #4 -->
        <component name='Navigation' level='3'/>
        <component name='Layering' level='1'/>
        <unit name='AngleUnitConversion' category='angle' conversionFactor='1.0'/>
        <unit name='LengthUnitConversion' category='length' conversionFactor='1.0'/>
        <meta name='title' content='HelloWorldProgramOutput.x3d'/>
        <meta name='description' content='Example HelloWorldProgram creates an X3D model using the X3D Java Scene Access Interface Library (X3DJSAIL)'/>
        <meta name='reference' content='http://www.web3d.org/specifications/java/X3DJSAIL.html'/>
        <meta name='generator' content='HelloWorldProgramOutput.java'/>
        <meta name='created' content='6 September 2016'/>
        <meta name='modified' content='14 October 2018'/>
        <meta name='generator' content='X3D Java Scene Access Interface Library (X3DJSAIL)'/>
        <meta name='generator' content='http://www.web3d.org/specifications/java/examples/HelloWorldProgram.java'/>
        <meta name='generator' content='Netbeans http://www.netbeans.org'/>
        <meta name='creator' content='Don Brutzman'/>
        <meta name='reference' content='https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/java/examples/HelloWorldProgramOutput.x3d'/>
        <meta name='reference' content='Console output, ClassicVRML encoding, VRML97 encoding and pretty-print documentation:'/>
        <meta name='reference' content='HelloWorldProgramOutput.txt'/>
        <meta name='reference' content='HelloWorldProgramOutput.x3dv'/>
        <meta name='reference' content='HelloWorldProgramOutput.wrl'/>
        <meta name='reference' content='HelloWorldProgramOutput.html'/>
        <meta name='X3dValidator' content='https://savage.nps.edu/X3dValidator?url=http://www.web3d.org/specifications/java/examples/HelloWorldProgramOutput.x3d'/>
        <meta name='identifier' content='http://www.web3d.org/specifications/java/examples/HelloWorldProgramOutput.x3d'/>
        <meta name='license' content='../license.html'/>
        <meta name='SpecialTest' content='tested sat: name value cannot contain embedded space character'/>
    </head>
    <Scene>
        <ViewpointGroup description='Available viewpoints'>
            <Viewpoint DEF='DefaultView' description='Hello X3DJSAIL'/>
            <Viewpoint DEF='TopDownView' description='top-down view from above' orientation='1 0 0 -1.570796' position='0 100 0'/>
        </ViewpointGroup>
        <WorldInfo DEF='WorldInfoDEF' title='HelloWorldProgram produced by X3D Java SAI Library (X3DJSAIL)'/>
        <WorldInfo USE='WorldInfoDEF'/>
        <WorldInfo USE='WorldInfoDEF'/>
        <MetadataString DEF='scene.addChildMetadata' name='test' value='"Top-level root Metadata node beneath Scene needs to be one of &apos;-children&apos; in JSON encoding"'/>
        <LayerSet DEF='scene.addChildLayerSetTest' order='0'/>
        <Transform DEF='LogoGeometryTransform' translation='0 1.5 0'>
            <Anchor description='select for X3D Java SAI Library (X3DJSAIL) description' url='"../X3DJSAIL.html" "http://www.web3d.org/specifications/java/X3DJSAIL.html"'>
                <Shape DEF='BoxShape'>
                    <Appearance>
                        <Material DEF='GreenMaterial' diffuseColor='0 1 1' emissiveColor='0.8 0 0' transparency='0.1'/>
                        <ImageTexture url='"images/X3dJavaSceneAccessInterfaceSaiLibrary.png" "http://www.web3d.org/specifications/java/examples/images/X3dJavaSceneAccessInterfaceSaiLibrary.png"'/>
                    </Appearance>
                    <Box DEF='test-NMTOKEN_regex.0123456789' class='untextured'/>
                </Shape>
            </Anchor>
        </Transform>
        <Shape DEF='LineShape'>
            <Appearance>
                <Material emissiveColor='0.6 0.19607843 0.8'/>
            </Appearance>
            <IndexedLineSet coordIndex='0 1 2 3 4 0'>
                <!-- Coordinate 3-tuple point count: 6 -->
                <Coordinate point='0 1.5 0 2 1.5 0 2 1.5 -2 -2 1.5 -2 -2 1.5 0 0 1.5 0'/>
            </IndexedLineSet>
        </Shape>
        <PositionInterpolator DEF='BoxPathAnimator' key='0 0.125 0.375 0.625 0.875 1' keyValue='0 1.5 0 2 1.5 0 2 1.5 -2 -2 1.5 -2 -2 1.5 0 0 1.5 0'/>
        <TimeSensor DEF='OrbitClock' cycleInterval='8.0' loop='true'/>
        <ROUTE fromField='fraction_changed' fromNode='OrbitClock' toField='set_fraction' toNode='BoxPathAnimator'/>
        <ROUTE fromField='value_changed' fromNode='BoxPathAnimator' toField='set_translation' toNode='LogoGeometryTransform'/>
        <Transform DEF='TextTransform' translation='0 -1.5 0'>
            <Shape>
                <Appearance>
                    <Material USE='GreenMaterial'/>
                </Appearance>
                <Text string='"X3D Java" "SAI Library" "X3DJSAIL"'>
                    <!-- Comment example A, plain quotation marks: He said, "Immel did it!" -->
                    <!-- Comment example B, XML character entities: He said, &quot;Immel did it!&quot; -->
                    <MetadataSet name='EscapedQuotationMarksMetadataSet'>
                        <MetadataString name='quotesTestC' containerField='value' value='"MFString example C, backslash-escaped quotes: He said, \"Immel did it!\""'/>
                        <MetadataString name='extraChildTest' containerField='value' value='"checks MetadataSetObject addValue() method"'/>
                    </MetadataSet>
                    <FontStyle/>
                </Text>
            </Shape>
            <Collision>
                <!-- test containerField='proxy' -->
                <Shape DEF='ProxyShape' containerField='proxy'>
                    <!-- alternative XML encoding: Text string='"One, Two, Comment" "" "He said, \&quot;Immel did it!\&quot;"' -->
                    <!-- alternative XML encoding: Text string='"One, Two, Comment" "" "He said, \&quot;Immel did it!\&quot;" ""' -->
                    <!-- alternative Java source: .setString(new String [] {"One, Two, Comment", "", "He said, \"Immel did it!\""}) -->
                    <!-- reference: http://www.web3d.org/x3d/content/examples/Basic/X3dSpecifications/StringArrayEncodingExamplesIndex.html -->
                    <Text string='"One, Two, Text" "" "He said, \"Immel did it!\" \"\""'/>
                </Shape>
            </Collision>
            <!-- It's a beautiful world -->
            <!-- ... for you! -->
            <!-- https://en.wikipedia.org/wiki/Beautiful_World_(Devo_song) -->
        </Transform>
        <!-- repeatedly spin 180 degrees as a readable special effect -->
        <OrientationInterpolator DEF='SpinInterpolator' keyValue='0 1 0 4.712389 0 1 0 0 0 1 0 1.5707964'/>
        <TimeSensor DEF='SpinClock' cycleInterval='5.0' loop='true'/>
        <ROUTE fromField='fraction_changed' fromNode='SpinClock' toField='set_fraction' toNode='SpinInterpolator'/>
        <ROUTE fromField='value_changed' fromNode='SpinInterpolator' toField='rotation' toNode='TextTransform'/>
        <Group DEF='BackgroundGroup'>
            <Background DEF='GradualBackground'/>
            <Script DEF='colorTypeConversionScript'>
                <field name='colorInput' accessType='inputOnly' type='SFColor'/>
                <field name='colorsOutput' accessType='outputOnly' type='MFColor'/>
<![CDATA[
ecmascript:

function colorInput (eventValue) // Example source code
{
   colorsOutput = new MFColor(eventValue); // assigning value sends output event
// Browser.print('colorInput=' + eventValue + ', colorsOutput=' + colorsOutput + '\n');
}
]]>
            </Script>
            <ColorInterpolator DEF='ColorAnimator' keyValue='0.9411765 1 1 0.29411766 0 0.50980395 0.9411765 1 1'>
                <!-- AZURE to INDIGO and back again -->
            </ColorInterpolator>
            <TimeSensor DEF='ColorClock' cycleInterval='60.0' loop='true'/>
            <ROUTE fromField='colorsOutput' fromNode='colorTypeConversionScript' toField='skyColor' toNode='GradualBackground'/>
            <ROUTE fromField='value_changed' fromNode='ColorAnimator' toField='colorInput' toNode='colorTypeConversionScript'/>
            <ROUTE fromField='fraction_changed' fromNode='ColorClock' toField='set_fraction' toNode='ColorAnimator'/>
        </Group>
        <ProtoDeclare name='ArtDeco01Material' appinfo='tooltip: ArtDeco01Material prototype is a Material node'>
            <ProtoInterface>
                <field name='description' accessType='inputOutput' appinfo='tooltip for descriptionField' type='SFString' value='ArtDeco01Material prototype is a Material node'/>
                <field name='enabled' accessType='inputOutput' type='SFBool' value='true'/>
            </ProtoInterface>
            <ProtoBody>
                <!-- Initial node of ProtoBody determines prototype node type -->
                <Material ambientIntensity='0.25' diffuseColor='0.282435 0.085159 0.134462' shininess='0.127273' specularColor='0.276305 0.11431 0.139857'/>
                <!-- [HelloWorldProgram diagnostic] should be connected to scene graph: artDeco01ProtoDeclare.getNodeType()="Material" -->
                <!-- presence of follow-on TouchSensor shows that additional nodes are allowed in ProtoBody after initial node, regardless of node types -->
                <TouchSensor description='within ProtoBody'>
                    <IS>
                        <connect nodeField='description' protoField='description'/>
                        <connect nodeField='enabled' protoField='enabled'/>
                    </IS>
                </TouchSensor>
            </ProtoBody>
        </ProtoDeclare>
        <ExternProtoDeclare name='ArtDeco02Material' appinfo='this is a different Material node' url='"http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter14Prototypes/ArtDecoPrototypesExcerpt.x3d#ArtDeco02Material" "http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter14Prototypes/ArtDecoPrototypesExcerpt.x3dv#ArtDeco02Material"'>
            <!-- [HelloWorldProgram diagnostic] artDeco02ExternProtoDeclare.getNodeType()="ERROR_UNKNOWN_EXTERNPROTODECLARE_NODE_TYPE: ExternProtoDeclare name='ArtDeco02Material' type cannot be remotely accessed at run time. TODO X3DJSAIL needs to add further capability that retrieves the ExternProtoDeclare file." -->
            <field name='description' accessType='inputOutput' appinfo='tooltip for descriptionField' type='SFString'/>
        </ExternProtoDeclare>
        <!-- Tested ArtDeco01ProtoInstance, ArtDeco02ProtoInstance for improper node type when ProtoInstance is added in wrong place -->
        <Shape DEF='TestShape1'>
            <Appearance DEF='TestAppearance1'>
                <!-- ArtDeco01Material prototype goes here... TODO ensure setContainerField is handled in exported Java -->
                <ProtoInstance name='ArtDeco01Material' containerField='material'>
                    <!-- [HelloWorldProgram diagnostic] ArtDeco01ProtoInstance.getNodeType()="Material" -->
                    <fieldValue name='description' value='ArtDeco01Material can substitute for a Material node'/>
                </ProtoInstance>
            </Appearance>
            <Sphere radius='0.001'/>
        </Shape>
        <Shape DEF='TestShape2'>
            <Appearance DEF='TestAppearance2'>
                <!-- ArtDeco02Material prototype goes here... TODO ensure setContainerField is handled in exported Java -->
                <ProtoInstance DEF='ArtDeco02MaterialDEF' name='ArtDeco02Material' containerField='material'>
                    <!-- [HelloWorldProgram diagnostic] ArtDeco02ProtoInstance.getNodeType()="ERROR_UNKNOWN_EXTERNPROTODECLARE_NODE_TYPE: ExternProtoDeclare name='ArtDeco02Material' type cannot be remotely accessed at run time. TODO X3DJSAIL needs to add further capability that retrieves the ExternProtoDeclare file." -->
                    <fieldValue name='description' value='ArtDeco02Material can substitute for another Material node'/>
                </ProtoInstance>
            </Appearance>
            <Cone bottomRadius='0.001' height='0.001'/>
        </Shape>
        <Shape DEF='TestShape3'>
            <Appearance DEF='TestAppearance3'>
                <!-- ArtDeco02Material ProtoInstance USE goes here... -->
                <ProtoInstance USE='ArtDeco02MaterialDEF' containerField='material'/>
            </Appearance>
            <Cylinder height='0.001' radius='0.001'/>
        </Shape>
        <Inline DEF='inlineSceneDef' url='"someOtherScene.x3d"'/>
        <IMPORT AS='WorldInfoDEF2' importedDEF='WorldInfoDEF' inlineDEF='inlineSceneDef'/>
        <EXPORT AS='WorldInfoDEF3' localDEF='WorldInfoDEF'/>
        <ProtoDeclare name='MaterialModulator' appinfo='mimic a Material node and modulate fields as an animation effect' documentation='http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter14Prototypes/MaterialModulatorIndex.html'>
            <ProtoInterface>
                <field name='enabled' accessType='inputOutput' type='SFBool' value='true'/>
                <field name='diffuseColor' accessType='inputOutput' type='SFColor' value='0 0 0'/>
                <field name='emissiveColor' accessType='inputOutput' type='SFColor' value='0.05 0.05 0.5'/>
                <field name='specularColor' accessType='inputOutput' type='SFColor' value='0 0 0'/>
                <field name='transparency' accessType='inputOutput' type='SFFloat' value='0.0'/>
                <field name='shininess' accessType='inputOutput' type='SFFloat' value='0.0'/>
                <field name='ambientIntensity' accessType='inputOutput' type='SFFloat' value='0.0'/>
            </ProtoInterface>
            <ProtoBody>
                <Material DEF='MaterialNode'>
                    <IS>
                        <connect nodeField='diffuseColor' protoField='diffuseColor'/>
                        <connect nodeField='emissiveColor' protoField='emissiveColor'/>
                        <connect nodeField='specularColor' protoField='specularColor'/>
                        <connect nodeField='transparency' protoField='transparency'/>
                        <connect nodeField='shininess' protoField='shininess'/>
                        <connect nodeField='ambientIntensity' protoField='ambientIntensity'/>
                    </IS>
                </Material>
                <!-- Only first node (the node type) is renderable, others are along for the ride -->
                <Script DEF='MaterialModulatorScript'>
                    <field name='enabled' accessType='inputOutput' type='SFBool'/>
                    <field name='diffuseColor' accessType='inputOutput' type='SFColor'/>
                    <field name='newColor' accessType='outputOnly' type='SFColor'/>
                    <field name='clockTrigger' accessType='inputOnly' type='SFTime'/>
                    <IS>
                        <connect nodeField='enabled' protoField='enabled'/>
                        <connect nodeField='diffuseColor' protoField='diffuseColor'/>
                    </IS>
<![CDATA[
ecmascript:
function initialize ()
{
    newColor = diffuseColor; // start with correct color
}
function set_enabled (newValue)
{
	enabled = newValue;
}
function clockTrigger (timeValue)
{
    if (!enabled) return;
    red   = newColor.r;
    green = newColor.g;
    blue  = newColor.b;
    
    // note different modulation rates for each color component, % is modulus operator
    newColor = new SFColor ((red + 0.02) % 1, (green + 0.03) % 1, (blue + 0.04) % 1);
	if (enabled)
	{
		Browser.print ('diffuseColor=(' + red + ',' + green + ',' + blue + ') newColor=' + newColor.toString() + '\n');
	}
}
]]>
                </Script>
            </ProtoBody>
        </ProtoDeclare>
        <!-- Test success: declarative statement createDeclarativeShapeTests() -->
        <Group DEF='DeclarativeGroupExample'>
            <Shape>
                <MetadataString DEF='FindableMetadataStringTest' name='findThisNameValue' value='"test case"'/>
                <Appearance DEF='DeclarativeAppearanceExample'>
                    <!-- DeclarativeMaterialExample gets overridden by subsequently added MaterialModulator ProtoInstance -->
                    <ProtoInstance DEF='MyMaterialModulator' name='MaterialModulator' containerField='material'/>
                </Appearance>
                <Cone bottom='false' bottomRadius='0.05' height='0.1'/>
            </Shape>
            <!-- Test success: declarativeGroup.addChild() singleton pipeline method -->
        </Group>
        <!-- Test success: declarative statement addChild() -->
        <!-- Test success: x3dModel.findNodeByDEF(DeclarativeAppearanceExample) = <Appearance DEF='DeclarativeAppearanceExample'/> i.e. <Appearance DEF='DeclarativeAppearanceExample'> <!- - DeclarativeMaterialExample gets overridden by subsequently added MaterialModulator ProtoInstance - -> <ProtoInstance DEF='MyMaterialModulator' name='MaterialModulator' containerField='material'/> </Appearance> -->
        <!-- Test success: x3dModel.findElementByNameValue(findThisNameValue) = <MetadataString DEF='FindableMetadataStringTest' name='findThisNameValue' value='"test case"'/> -->
        <!-- Test success: x3dModel.findElementByNameValue("ArtDeco01Material", "ProtoDeclare") found -->
        <!-- Test success: x3dModel.findElementByNameValue("MaterialModulator", "ProtoDeclare") found -->
        <!-- Test success: x3dModel.findElementByNameValue("MaterialModulator", "ProtoInstance") found -->
        <Group DEF='TestFieldObjectsGroup'>
            <!-- testFieldObjects() results -->
            <!-- SFBool default=true, true=true, false=false, negate()=true -->
            <!-- MFBool default=, initial=true false true, negate()=false true false -->
            <!-- SFFloat default=0.0, initial=1.0, setValue(2)=2.0, setValue(3.0f)=3.0, setValue(4.0)=4.0 -->
            <!-- MFFloat default=, initial=1 2 3, append(5)=1 2 3 5, inserts(3,4)(0,0)=0 1 2 3 4 5, append(6)=0 1 2 3 4 5 6, size()=7 -->
            <!-- ... get1Value[3]=3.0, remove[1]=0 2 3 4 5 6, set1Value(0,10)=10 2 3 4 5 6, multiply(2)=20 4 6 8 10 12, clear= -->
            <!-- SFVec3f default=0 0 0, initial=1 2 3, setValue=4 5 6, multiply(2)=8 10 12, normalize()=0.45584232 0.5698029 0.68376344, regex matches()=true -->
            <!-- regex test SFVec3f().matches("1 2 3")=true, regex test SFVec3f().matches("1 2 3 4")=false, regex test (SFRotationObject.matches("0 0 0 0")=true, failure detecting illegal (zero axis) rotation value -->
        </Group>
        <Sound location='0 1.6 0'>
            <!-- set sound-ellipsoid location height at 1.6m to match typical avatar height -->
            <AudioClip description='chimes' url='"chimes.wav" "http://www.web3d.org/x3d/content/examples/ConformanceNist/Sounds/AudioClip/chimes.wav"'>
                <!-- Scene example fragment from http://www.web3d.org/x3d/content/examples/ConformanceNist/Sounds/AudioClip/default.x3d -->
            </AudioClip>
        </Sound>
        <Sound location='0 1.6 0'>
            <!-- set sound-ellipsoid location height at 1.6m to match typical avatar height -->
            <MovieTexture containerField='source' description='mpgsys.mpg from ConformanceNist suite' url='"mpgsys.mpg" "http://www.web3d.org/x3d/content/examples/ConformanceNist/Appearance/MovieTexture/mpgsys.mpg"'>
                <!-- Scene example fragment from http://www.web3d.org/x3d/content/examples/ConformanceNist/Appearance/MovieTexture/mpeg1-systems.x3d -->
                <!-- Expected containerField='source', allowed containerField values="texture" "source" "back" "bottom" "front" "left" "right" "top" "backTexture" "bottomTexture" "frontTexture" "leftTexture" "rightTexture" "topTexture" "watchList" -->
            </MovieTexture>
        </Sound>
        <!-- Test success: AnchorObject.isNode()=true, siteAnchor.isNode()=true -->
        <!-- Test success: AnchorObject.isStatement()=false, siteAnchor.isStatement()=false -->
        <!-- Test success: ROUTEObject.isNode()=false, orbitPositionROUTE.isNode()=false -->
        <!-- Test success: ROUTEObject.isStatement()=true, orbitPositionROUTE.isStatement()=true -->
        <!-- Test success: CommentsBlock.isNode()=false, testComments.isNode()=false -->
        <!-- Test failure: CommentsBlock.isStatement()=true, testComments.isStatement()=true -->
        <Shape DEF='ExtrusionShape'>
            <!-- ExampleExtrusion isCrossSectionClosed()=true, crossSection='[1.0, 1.0, 1.0, -1.0, -1.0, -1.0, -1.0, 1.0, 1.0, 1.0]' -->
            <!-- ExampleExtrusion isSpineClosed()=false, spine='[0.0, 0.0, 0.0, 0.0, 1.0, 0.0]' -->
            <Appearance DEF='TransparentAppearance'>
                <Material transparency='1.0'/>
            </Appearance>
            <Extrusion DEF='ExampleExtrusion'/>
        </Shape>
    </Scene>
</X3D>

===========================================
x3dModel.toStringXML()

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "http://www.web3d.org/specifications/x3d-3.3.dtd">
<X3D profile='Immersive' version='3.3' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-3.3.xsd'>
    <head>
        <!-- comment #1 -->
        <!-- comment #2 -->
        <!-- comment #3 -->
        <!-- comment #4 -->
        <component name='Navigation' level='3'/>
        <component name='Layering' level='1'/>
        <unit name='AngleUnitConversion' category='angle' conversionFactor='1.0'/>
        <unit name='LengthUnitConversion' category='length' conversionFactor='1.0'/>
        <meta name='title' content='HelloWorldProgramOutput.x3d'/>
        <meta name='description' content='Example HelloWorldProgram creates an X3D model using the X3D Java Scene Access Interface Library (X3DJSAIL)'/>
        <meta name='reference' content='http://www.web3d.org/specifications/java/X3DJSAIL.html'/>
        <meta name='generator' content='HelloWorldProgramOutput.java'/>
        <meta name='created' content='6 September 2016'/>
        <meta name='modified' content='14 October 2018'/>
        <meta name='generator' content='X3D Java Scene Access Interface Library (X3DJSAIL)'/>
        <meta name='generator' content='http://www.web3d.org/specifications/java/examples/HelloWorldProgram.java'/>
        <meta name='generator' content='Netbeans http://www.netbeans.org'/>
        <meta name='creator' content='Don Brutzman'/>
        <meta name='reference' content='https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/java/examples/HelloWorldProgramOutput.x3d'/>
        <meta name='reference' content='Console output, ClassicVRML encoding, VRML97 encoding and pretty-print documentation:'/>
        <meta name='reference' content='HelloWorldProgramOutput.txt'/>
        <meta name='reference' content='HelloWorldProgramOutput.x3dv'/>
        <meta name='reference' content='HelloWorldProgramOutput.wrl'/>
        <meta name='reference' content='HelloWorldProgramOutput.html'/>
        <meta name='X3dValidator' content='https://savage.nps.edu/X3dValidator?url=http://www.web3d.org/specifications/java/examples/HelloWorldProgramOutput.x3d'/>
        <meta name='identifier' content='http://www.web3d.org/specifications/java/examples/HelloWorldProgramOutput.x3d'/>
        <meta name='license' content='../license.html'/>
        <meta name='SpecialTest' content='tested sat: name value cannot contain embedded space character'/>
    </head>
    <Scene>
        <ViewpointGroup description='Available viewpoints'>
            <Viewpoint DEF='DefaultView' description='Hello X3DJSAIL'/>
            <Viewpoint DEF='TopDownView' description='top-down view from above' orientation='1 0 0 -1.570796' position='0 100 0'/>
        </ViewpointGroup>
        <WorldInfo DEF='WorldInfoDEF' title='HelloWorldProgram produced by X3D Java SAI Library (X3DJSAIL)'/>
        <WorldInfo USE='WorldInfoDEF'/>
        <WorldInfo USE='WorldInfoDEF'/>
        <MetadataString DEF='scene.addChildMetadata' name='test' value='"Top-level root Metadata node beneath Scene needs to be one of &apos;-children&apos; in JSON encoding"'/>
        <LayerSet DEF='scene.addChildLayerSetTest' order='0'/>
        <Transform DEF='LogoGeometryTransform' translation='0 1.5 0'>
            <Anchor description='select for X3D Java SAI Library (X3DJSAIL) description' url='"../X3DJSAIL.html" "http://www.web3d.org/specifications/java/X3DJSAIL.html"'>
                <Shape DEF='BoxShape'>
                    <Appearance>
                        <Material DEF='GreenMaterial' diffuseColor='0 1 1' emissiveColor='0.8 0 0' transparency='0.1'/>
                        <ImageTexture url='"images/X3dJavaSceneAccessInterfaceSaiLibrary.png" "http://www.web3d.org/specifications/java/examples/images/X3dJavaSceneAccessInterfaceSaiLibrary.png"'/>
                    </Appearance>
                    <Box DEF='test-NMTOKEN_regex.0123456789' class='untextured'/>
                </Shape>
            </Anchor>
        </Transform>
        <Shape DEF='LineShape'>
            <Appearance>
                <Material emissiveColor='0.6 0.19607843 0.8'/>
            </Appearance>
            <IndexedLineSet coordIndex='0 1 2 3 4 0'>
                <!-- Coordinate 3-tuple point count: 6 -->
                <Coordinate point='0 1.5 0 2 1.5 0 2 1.5 -2 -2 1.5 -2 -2 1.5 0 0 1.5 0'/>
            </IndexedLineSet>
        </Shape>
        <PositionInterpolator DEF='BoxPathAnimator' key='0 0.125 0.375 0.625 0.875 1' keyValue='0 1.5 0 2 1.5 0 2 1.5 -2 -2 1.5 -2 -2 1.5 0 0 1.5 0'/>
        <TimeSensor DEF='OrbitClock' cycleInterval='8.0' loop='true'/>
        <ROUTE fromField='fraction_changed' fromNode='OrbitClock' toField='set_fraction' toNode='BoxPathAnimator'/>
        <ROUTE fromField='value_changed' fromNode='BoxPathAnimator' toField='set_translation' toNode='LogoGeometryTransform'/>
        <Transform DEF='TextTransform' translation='0 -1.5 0'>
            <Shape>
                <Appearance>
                    <Material USE='GreenMaterial'/>
                </Appearance>
                <Text string='"X3D Java" "SAI Library" "X3DJSAIL"'>
                    <!-- Comment example A, plain quotation marks: He said, "Immel did it!" -->
                    <!-- Comment example B, XML character entities: He said, &quot;Immel did it!&quot; -->
                    <MetadataSet name='EscapedQuotationMarksMetadataSet'>
                        <MetadataString name='quotesTestC' containerField='value' value='"MFString example C, backslash-escaped quotes: He said, \"Immel did it!\""'/>
                        <MetadataString name='extraChildTest' containerField='value' value='"checks MetadataSetObject addValue() method"'/>
                    </MetadataSet>
                    <FontStyle/>
                </Text>
            </Shape>
            <Collision>
                <!-- test containerField='proxy' -->
                <Shape DEF='ProxyShape' containerField='proxy'>
                    <!-- alternative XML encoding: Text string='"One, Two, Comment" "" "He said, \&quot;Immel did it!\&quot;"' -->
                    <!-- alternative XML encoding: Text string='"One, Two, Comment" "" "He said, \&quot;Immel did it!\&quot;" ""' -->
                    <!-- alternative Java source: .setString(new String [] {"One, Two, Comment", "", "He said, \"Immel did it!\""}) -->
                    <!-- reference: http://www.web3d.org/x3d/content/examples/Basic/X3dSpecifications/StringArrayEncodingExamplesIndex.html -->
                    <Text string='"One, Two, Text" "" "He said, \"Immel did it!\" \"\""'/>
                </Shape>
            </Collision>
            <!-- It's a beautiful world -->
            <!-- ... for you! -->
            <!-- https://en.wikipedia.org/wiki/Beautiful_World_(Devo_song) -->
        </Transform>
        <!-- repeatedly spin 180 degrees as a readable special effect -->
        <OrientationInterpolator DEF='SpinInterpolator' keyValue='0 1 0 4.712389 0 1 0 0 0 1 0 1.5707964'/>
        <TimeSensor DEF='SpinClock' cycleInterval='5.0' loop='true'/>
        <ROUTE fromField='fraction_changed' fromNode='SpinClock' toField='set_fraction' toNode='SpinInterpolator'/>
        <ROUTE fromField='value_changed' fromNode='SpinInterpolator' toField='rotation' toNode='TextTransform'/>
        <Group DEF='BackgroundGroup'>
            <Background DEF='GradualBackground'/>
            <Script DEF='colorTypeConversionScript'>
                <field name='colorInput' accessType='inputOnly' type='SFColor'/>
                <field name='colorsOutput' accessType='outputOnly' type='MFColor'/>
<![CDATA[
ecmascript:

function colorInput (eventValue) // Example source code
{
   colorsOutput = new MFColor(eventValue); // assigning value sends output event
// Browser.print('colorInput=' + eventValue + ', colorsOutput=' + colorsOutput + '\n');
}
]]>
            </Script>
            <ColorInterpolator DEF='ColorAnimator' keyValue='0.9411765 1 1 0.29411766 0 0.50980395 0.9411765 1 1'>
                <!-- AZURE to INDIGO and back again -->
            </ColorInterpolator>
            <TimeSensor DEF='ColorClock' cycleInterval='60.0' loop='true'/>
            <ROUTE fromField='colorsOutput' fromNode='colorTypeConversionScript' toField='skyColor' toNode='GradualBackground'/>
            <ROUTE fromField='value_changed' fromNode='ColorAnimator' toField='colorInput' toNode='colorTypeConversionScript'/>
            <ROUTE fromField='fraction_changed' fromNode='ColorClock' toField='set_fraction' toNode='ColorAnimator'/>
        </Group>
        <ProtoDeclare name='ArtDeco01Material' appinfo='tooltip: ArtDeco01Material prototype is a Material node'>
            <ProtoInterface>
                <field name='description' accessType='inputOutput' appinfo='tooltip for descriptionField' type='SFString' value='ArtDeco01Material prototype is a Material node'/>
                <field name='enabled' accessType='inputOutput' type='SFBool' value='true'/>
            </ProtoInterface>
            <ProtoBody>
                <!-- Initial node of ProtoBody determines prototype node type -->
                <Material ambientIntensity='0.25' diffuseColor='0.282435 0.085159 0.134462' shininess='0.127273' specularColor='0.276305 0.11431 0.139857'/>
                <!-- [HelloWorldProgram diagnostic] should be connected to scene graph: artDeco01ProtoDeclare.getNodeType()="Material" -->
                <!-- presence of follow-on TouchSensor shows that additional nodes are allowed in ProtoBody after initial node, regardless of node types -->
                <TouchSensor description='within ProtoBody'>
                    <IS>
                        <connect nodeField='description' protoField='description'/>
                        <connect nodeField='enabled' protoField='enabled'/>
                    </IS>
                </TouchSensor>
            </ProtoBody>
        </ProtoDeclare>
        <ExternProtoDeclare name='ArtDeco02Material' appinfo='this is a different Material node' url='"http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter14Prototypes/ArtDecoPrototypesExcerpt.x3d#ArtDeco02Material" "http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter14Prototypes/ArtDecoPrototypesExcerpt.x3dv#ArtDeco02Material"'>
            <!-- [HelloWorldProgram diagnostic] artDeco02ExternProtoDeclare.getNodeType()="ERROR_UNKNOWN_EXTERNPROTODECLARE_NODE_TYPE: ExternProtoDeclare name='ArtDeco02Material' type cannot be remotely accessed at run time. TODO X3DJSAIL needs to add further capability that retrieves the ExternProtoDeclare file." -->
            <field name='description' accessType='inputOutput' appinfo='tooltip for descriptionField' type='SFString'/>
        </ExternProtoDeclare>
        <!-- Tested ArtDeco01ProtoInstance, ArtDeco02ProtoInstance for improper node type when ProtoInstance is added in wrong place -->
        <Shape DEF='TestShape1'>
            <Appearance DEF='TestAppearance1'>
                <!-- ArtDeco01Material prototype goes here... TODO ensure setContainerField is handled in exported Java -->
                <ProtoInstance name='ArtDeco01Material' containerField='material'>
                    <!-- [HelloWorldProgram diagnostic] ArtDeco01ProtoInstance.getNodeType()="Material" -->
                    <fieldValue name='description' value='ArtDeco01Material can substitute for a Material node'/>
                </ProtoInstance>
            </Appearance>
            <Sphere radius='0.001'/>
        </Shape>
        <Shape DEF='TestShape2'>
            <Appearance DEF='TestAppearance2'>
                <!-- ArtDeco02Material prototype goes here... TODO ensure setContainerField is handled in exported Java -->
                <ProtoInstance DEF='ArtDeco02MaterialDEF' name='ArtDeco02Material' containerField='material'>
                    <!-- [HelloWorldProgram diagnostic] ArtDeco02ProtoInstance.getNodeType()="ERROR_UNKNOWN_EXTERNPROTODECLARE_NODE_TYPE: ExternProtoDeclare name='ArtDeco02Material' type cannot be remotely accessed at run time. TODO X3DJSAIL needs to add further capability that retrieves the ExternProtoDeclare file." -->
                    <fieldValue name='description' value='ArtDeco02Material can substitute for another Material node'/>
                </ProtoInstance>
            </Appearance>
            <Cone bottomRadius='0.001' height='0.001'/>
        </Shape>
        <Shape DEF='TestShape3'>
            <Appearance DEF='TestAppearance3'>
                <!-- ArtDeco02Material ProtoInstance USE goes here... -->
                <ProtoInstance USE='ArtDeco02MaterialDEF' containerField='material'/>
            </Appearance>
            <Cylinder height='0.001' radius='0.001'/>
        </Shape>
        <Inline DEF='inlineSceneDef' url='"someOtherScene.x3d"'/>
        <IMPORT AS='WorldInfoDEF2' importedDEF='WorldInfoDEF' inlineDEF='inlineSceneDef'/>
        <EXPORT AS='WorldInfoDEF3' localDEF='WorldInfoDEF'/>
        <ProtoDeclare name='MaterialModulator' appinfo='mimic a Material node and modulate fields as an animation effect' documentation='http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter14Prototypes/MaterialModulatorIndex.html'>
            <ProtoInterface>
                <field name='enabled' accessType='inputOutput' type='SFBool' value='true'/>
                <field name='diffuseColor' accessType='inputOutput' type='SFColor' value='0 0 0'/>
                <field name='emissiveColor' accessType='inputOutput' type='SFColor' value='0.05 0.05 0.5'/>
                <field name='specularColor' accessType='inputOutput' type='SFColor' value='0 0 0'/>
                <field name='transparency' accessType='inputOutput' type='SFFloat' value='0.0'/>
                <field name='shininess' accessType='inputOutput' type='SFFloat' value='0.0'/>
                <field name='ambientIntensity' accessType='inputOutput' type='SFFloat' value='0.0'/>
            </ProtoInterface>
            <ProtoBody>
                <Material DEF='MaterialNode'>
                    <IS>
                        <connect nodeField='diffuseColor' protoField='diffuseColor'/>
                        <connect nodeField='emissiveColor' protoField='emissiveColor'/>
                        <connect nodeField='specularColor' protoField='specularColor'/>
                        <connect nodeField='transparency' protoField='transparency'/>
                        <connect nodeField='shininess' protoField='shininess'/>
                        <connect nodeField='ambientIntensity' protoField='ambientIntensity'/>
                    </IS>
                </Material>
                <!-- Only first node (the node type) is renderable, others are along for the ride -->
                <Script DEF='MaterialModulatorScript'>
                    <field name='enabled' accessType='inputOutput' type='SFBool'/>
                    <field name='diffuseColor' accessType='inputOutput' type='SFColor'/>
                    <field name='newColor' accessType='outputOnly' type='SFColor'/>
                    <field name='clockTrigger' accessType='inputOnly' type='SFTime'/>
                    <IS>
                        <connect nodeField='enabled' protoField='enabled'/>
                        <connect nodeField='diffuseColor' protoField='diffuseColor'/>
                    </IS>
<![CDATA[
ecmascript:
function initialize ()
{
    newColor = diffuseColor; // start with correct color
}
function set_enabled (newValue)
{
	enabled = newValue;
}
function clockTrigger (timeValue)
{
    if (!enabled) return;
    red   = newColor.r;
    green = newColor.g;
    blue  = newColor.b;
    
    // note different modulation rates for each color component, % is modulus operator
    newColor = new SFColor ((red + 0.02) % 1, (green + 0.03) % 1, (blue + 0.04) % 1);
	if (enabled)
	{
		Browser.print ('diffuseColor=(' + red + ',' + green + ',' + blue + ') newColor=' + newColor.toString() + '\n');
	}
}
]]>
                </Script>
            </ProtoBody>
        </ProtoDeclare>
        <!-- Test success: declarative statement createDeclarativeShapeTests() -->
        <Group DEF='DeclarativeGroupExample'>
            <Shape>
                <MetadataString DEF='FindableMetadataStringTest' name='findThisNameValue' value='"test case"'/>
                <Appearance DEF='DeclarativeAppearanceExample'>
                    <!-- DeclarativeMaterialExample gets overridden by subsequently added MaterialModulator ProtoInstance -->
                    <ProtoInstance DEF='MyMaterialModulator' name='MaterialModulator' containerField='material'/>
                </Appearance>
                <Cone bottom='false' bottomRadius='0.05' height='0.1'/>
            </Shape>
            <!-- Test success: declarativeGroup.addChild() singleton pipeline method -->
        </Group>
        <!-- Test success: declarative statement addChild() -->
        <!-- Test success: x3dModel.findNodeByDEF(DeclarativeAppearanceExample) = <Appearance DEF='DeclarativeAppearanceExample'/> i.e. <Appearance DEF='DeclarativeAppearanceExample'> <!- - DeclarativeMaterialExample gets overridden by subsequently added MaterialModulator ProtoInstance - -> <ProtoInstance DEF='MyMaterialModulator' name='MaterialModulator' containerField='material'/> </Appearance> -->
        <!-- Test success: x3dModel.findElementByNameValue(findThisNameValue) = <MetadataString DEF='FindableMetadataStringTest' name='findThisNameValue' value='"test case"'/> -->
        <!-- Test success: x3dModel.findElementByNameValue("ArtDeco01Material", "ProtoDeclare") found -->
        <!-- Test success: x3dModel.findElementByNameValue("MaterialModulator", "ProtoDeclare") found -->
        <!-- Test success: x3dModel.findElementByNameValue("MaterialModulator", "ProtoInstance") found -->
        <Group DEF='TestFieldObjectsGroup'>
            <!-- testFieldObjects() results -->
            <!-- SFBool default=true, true=true, false=false, negate()=true -->
            <!-- MFBool default=, initial=true false true, negate()=false true false -->
            <!-- SFFloat default=0.0, initial=1.0, setValue(2)=2.0, setValue(3.0f)=3.0, setValue(4.0)=4.0 -->
            <!-- MFFloat default=, initial=1 2 3, append(5)=1 2 3 5, inserts(3,4)(0,0)=0 1 2 3 4 5, append(6)=0 1 2 3 4 5 6, size()=7 -->
            <!-- ... get1Value[3]=3.0, remove[1]=0 2 3 4 5 6, set1Value(0,10)=10 2 3 4 5 6, multiply(2)=20 4 6 8 10 12, clear= -->
            <!-- SFVec3f default=0 0 0, initial=1 2 3, setValue=4 5 6, multiply(2)=8 10 12, normalize()=0.45584232 0.5698029 0.68376344, regex matches()=true -->
            <!-- regex test SFVec3f().matches("1 2 3")=true, regex test SFVec3f().matches("1 2 3 4")=false, regex test (SFRotationObject.matches("0 0 0 0")=true, failure detecting illegal (zero axis) rotation value -->
        </Group>
        <Sound location='0 1.6 0'>
            <!-- set sound-ellipsoid location height at 1.6m to match typical avatar height -->
            <AudioClip description='chimes' url='"chimes.wav" "http://www.web3d.org/x3d/content/examples/ConformanceNist/Sounds/AudioClip/chimes.wav"'>
                <!-- Scene example fragment from http://www.web3d.org/x3d/content/examples/ConformanceNist/Sounds/AudioClip/default.x3d -->
            </AudioClip>
        </Sound>
        <Sound location='0 1.6 0'>
            <!-- set sound-ellipsoid location height at 1.6m to match typical avatar height -->
            <MovieTexture containerField='source' description='mpgsys.mpg from ConformanceNist suite' url='"mpgsys.mpg" "http://www.web3d.org/x3d/content/examples/ConformanceNist/Appearance/MovieTexture/mpgsys.mpg"'>
                <!-- Scene example fragment from http://www.web3d.org/x3d/content/examples/ConformanceNist/Appearance/MovieTexture/mpeg1-systems.x3d -->
                <!-- Expected containerField='source', allowed containerField values="texture" "source" "back" "bottom" "front" "left" "right" "top" "backTexture" "bottomTexture" "frontTexture" "leftTexture" "rightTexture" "topTexture" "watchList" -->
            </MovieTexture>
        </Sound>
        <!-- Test success: AnchorObject.isNode()=true, siteAnchor.isNode()=true -->
        <!-- Test success: AnchorObject.isStatement()=false, siteAnchor.isStatement()=false -->
        <!-- Test success: ROUTEObject.isNode()=false, orbitPositionROUTE.isNode()=false -->
        <!-- Test success: ROUTEObject.isStatement()=true, orbitPositionROUTE.isStatement()=true -->
        <!-- Test success: CommentsBlock.isNode()=false, testComments.isNode()=false -->
        <!-- Test failure: CommentsBlock.isStatement()=true, testComments.isStatement()=true -->
        <Shape DEF='ExtrusionShape'>
            <!-- ExampleExtrusion isCrossSectionClosed()=true, crossSection='[1.0, 1.0, 1.0, -1.0, -1.0, -1.0, -1.0, 1.0, 1.0, 1.0]' -->
            <!-- ExampleExtrusion isSpineClosed()=false, spine='[0.0, 0.0, 0.0, 0.0, 1.0, 0.0]' -->
            <Appearance DEF='TransparentAppearance'>
                <Material transparency='1.0'/>
            </Appearance>
            <Extrusion DEF='ExampleExtrusion'/>
        </Shape>
    </Scene>
</X3D>

===========================================
x3dModel.toStringClassicVRML()

#X3D V3.3 utf8
PROFILE Immersive
# head
COMPONENT Navigation:3
COMPONENT Layering:1
UNIT angle AngleUnitConversion 1.0
UNIT length LengthUnitConversion 1.0
META "title" "HelloWorldProgramOutput.x3d"
META "description" "Example HelloWorldProgram creates an X3D model using the X3D Java Scene Access Interface Library (X3DJSAIL)"
META "reference" "http://www.web3d.org/specifications/java/X3DJSAIL.html"
META "generator" "HelloWorldProgramOutput.java"
META "created" "6 September 2016"
META "modified" "14 October 2018"
META "generator" "X3D Java Scene Access Interface Library (X3DJSAIL)"
META "generator" "http://www.web3d.org/specifications/java/examples/HelloWorldProgram.java"
META "generator" "Netbeans http://www.netbeans.org"
META "creator" "Don Brutzman"
META "reference" "https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/java/examples/HelloWorldProgramOutput.x3d"
META "reference" "Console output, ClassicVRML encoding, VRML97 encoding and pretty-print documentation:"
META "reference" "HelloWorldProgramOutput.txt"
META "reference" "HelloWorldProgramOutput.x3dv"
META "reference" "HelloWorldProgramOutput.wrl"
META "reference" "HelloWorldProgramOutput.html"
META "X3dValidator" "https://savage.nps.edu/X3dValidator?url=http://www.web3d.org/specifications/java/examples/HelloWorldProgramOutput.x3d"
META "identifier" "http://www.web3d.org/specifications/java/examples/HelloWorldProgramOutput.x3d"
META "license" "../license.html"
META "SpecialTest" "tested sat: name value cannot contain embedded space character"
# comment #1
# comment #2
# comment #3
# comment #4
# Scene
ViewpointGroup { 
 description "Available viewpoints"
   children [
  DEF DefaultView Viewpoint { 
         description "Hello X3DJSAIL"
         }
DEF TopDownView Viewpoint { 
         description "top-down view from above"
         orientation 1 0 0 -1.570796
         position 0 100 0
         }
  ]
}
DEF WorldInfoDEF WorldInfo { 
 title "HelloWorldProgram produced by X3D Java SAI Library (X3DJSAIL)"
 }
USE WorldInfoDEF
USE WorldInfoDEF
DEF scene.addChildMetadata MetadataString { 
 name "test"
 value [ "Top-level root Metadata node beneath Scene needs to be one of &apos;-children&apos; in JSON encoding" ]
 }
DEF scene.addChildLayerSetTest LayerSet { 
 order [ 0 ]
 }
DEF LogoGeometryTransform Transform { 
 translation 0 1.5 0
   children [
  Anchor { 
         description "select for X3D Java SAI Library (X3DJSAIL) description"
         url [ "../X3DJSAIL.html" "http://www.web3d.org/specifications/java/X3DJSAIL.html" ]
           children [
          DEF BoxShape Shape { 
                  appearance Appearance { 
                      material DEF GreenMaterial Material { 
                         diffuseColor 0 1 1
                         emissiveColor 0.8 0 0
                         transparency 0.1
                         }
                     texture ImageTexture { 
                         url [ "images/X3dJavaSceneAccessInterfaceSaiLibrary.png" "http://www.web3d.org/specifications/java/examples/images/X3dJavaSceneAccessInterfaceSaiLibrary.png" ]
                         }
                    }
                 geometry DEF test-NMTOKEN_regex.0123456789 Box { 
                     # class "untextured"
                     }
                }
          ]
        }
  ]
}
DEF LineShape Shape { 
  appearance Appearance { 
      material Material { 
         emissiveColor 0.6 0.19607843 0.8
         }
    }
 geometry IndexedLineSet { 
     coordIndex [ 0 1 2 3 4 0 ]
      coord Coordinate { 
         point [ 0 1.5 0 2 1.5 0 2 1.5 -2 -2 1.5 -2 -2 1.5 0 0 1.5 0 ]
         }
    # Coordinate 3-tuple point count: 6
        }
}
DEF BoxPathAnimator PositionInterpolator { 
 key [ 0 0.125 0.375 0.625 0.875 1 ]
 keyValue [ 0 1.5 0 2 1.5 0 2 1.5 -2 -2 1.5 -2 -2 1.5 0 0 1.5 0 ]
 }
DEF OrbitClock TimeSensor { 
 cycleInterval 8.0
 loop true
 }
ROUTE OrbitClock.fraction_changed TO BoxPathAnimator.set_fraction
ROUTE BoxPathAnimator.value_changed TO LogoGeometryTransform.set_translation
DEF TextTransform Transform { 
 translation 0 -1.5 0
   children [
  Shape { 
          appearance Appearance { 
              material USE GreenMaterial
            }
         geometry Text { 
             string [ "X3D Java" "SAI Library" "X3DJSAIL" ]
              fontStyle FontStyle { 
                 }
             metadata MetadataSet { 
                 name "EscapedQuotationMarksMetadataSet"
                   value [
                  MetadataString { 
                         name "quotesTestC"
                         value [ "MFString example C, backslash-escaped quotes: He said, \"Immel did it!\"" ]
                         }
MetadataString { 
                         name "extraChildTest"
                         value [ "checks MetadataSetObject addValue() method" ]
                         }
                  ]
                }
            # Comment example A, plain quotation marks: He said, "Immel did it!"
            # Comment example B, XML character entities: He said, &quot;Immel did it!&quot;
                        }
        }
Collision { 
           children [
          # test containerField='proxy'
                          ]
         proxy DEF ProxyShape Shape { 
              geometry Text { 
                 string [ "One, Two, Text" "" "He said, \"Immel did it!\" \"\"" ]
                 }
            #  alternative XML encoding: Text string='"One, Two, Comment" "" "He said, \&quot;Immel did it!\&quot;"' 
            #  alternative XML encoding: Text string='"One, Two, Comment" "" "He said, \&quot;Immel did it!\&quot;" ""' 
            #  alternative Java source: .setString(new String [] {"One, Two, Comment", "", "He said, \"Immel did it!\""})
            #  reference: http://www.web3d.org/x3d/content/examples/Basic/X3dSpecifications/StringArrayEncodingExamplesIndex.html 
                        }
        }
# It's a beautiful world
        # ... for you!
        # https://en.wikipedia.org/wiki/Beautiful_World_(Devo_song)
          ]
}
# repeatedly spin 180 degrees as a readable special effect
DEF SpinInterpolator OrientationInterpolator { 
 keyValue [ 0 1 0 4.712389 0 1 0 0 0 1 0 1.5707964 ]
 }
DEF SpinClock TimeSensor { 
 cycleInterval 5.0
 loop true
 }
ROUTE SpinClock.fraction_changed TO SpinInterpolator.set_fraction
ROUTE SpinInterpolator.value_changed TO TextTransform.rotation
DEF BackgroundGroup Group { 
   children [
  DEF GradualBackground Background { 
         }
DEF colorTypeConversionScript Script { 
              inputOnly SFColor colorInput
              outputOnly MFColor colorsOutput          url [ "ecmascript:

function colorInput (eventValue) // Example source code
{
   colorsOutput = new MFColor(eventValue); // assigning value sends output event
// Browser.print('colorInput=' + eventValue + ', colorsOutput=' + colorsOutput + '\n');
}
" ]
}
DEF ColorAnimator ColorInterpolator { 
         keyValue [ 0.9411765 1 1 0.29411766 0 0.50980395 0.9411765 1 1 ]
         # AZURE to INDIGO and back again
                }
DEF ColorClock TimeSensor { 
         cycleInterval 60.0
         loop true
         }
ROUTE colorTypeConversionScript.colorsOutput TO GradualBackground.skyColor
        ROUTE ColorAnimator.value_changed TO colorTypeConversionScript.colorInput
        ROUTE ColorClock.fraction_changed TO ColorAnimator.set_fraction
          ]
}
PROTO ArtDeco01Material [
   # [appinfo] "tooltip: ArtDeco01Material prototype is a Material node"
  # ProtoInterface
      inputOutput SFString description "ArtDeco01Material prototype is a Material node" # [appinfo] "tooltip for descriptionField"
    
      inputOutput SFBool enabled true] {

  # ProtoBody
  # Initial node of ProtoBody determines prototype node type
    Material { 
     ambientIntensity 0.25
     diffuseColor 0.282435 0.085159 0.134462
     shininess 0.127273
     specularColor 0.276305 0.11431 0.139857
     }
# [HelloWorldProgram diagnostic] should be connected to scene graph: artDeco01ProtoDeclare.getNodeType()="Material"
    #  presence of follow-on TouchSensor shows that additional nodes are allowed in ProtoBody after initial node, regardless of node types
    TouchSensor { 
      description IS description
      enabled IS enabled
     }
}
EXTERNPROTO ArtDeco02Material [
   # [appinfo] "this is a different Material node"
 url [ "http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter14Prototypes/ArtDecoPrototypesExcerpt.x3d#ArtDeco02Material" "http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter14Prototypes/ArtDecoPrototypesExcerpt.x3dv#ArtDeco02Material" ]
  inputOutput SFString description # [appinfo] "tooltip for descriptionField"
# [HelloWorldProgram diagnostic] artDeco02ExternProtoDeclare.getNodeType()="ERROR_UNKNOWN_EXTERNPROTODECLARE_NODE_TYPE: ExternProtoDeclare name='ArtDeco02Material' type cannot be remotely accessed at run time. TODO X3DJSAIL needs to add further capability that retrieves the ExternProtoDeclare file."
]
# Tested ArtDeco01ProtoInstance, ArtDeco02ProtoInstance for improper node type when ProtoInstance is added in wrong place
DEF TestShape1 Shape { 
  appearance DEF TestAppearance1 Appearance { 
      material ArtDeco01Material { name "ArtDeco01Material"

          description "ArtDeco01Material can substitute for a Material node"# [HelloWorldProgram diagnostic] ArtDeco01ProtoInstance.getNodeType()="Material"
                }
    # ArtDeco01Material prototype goes here... TODO ensure setContainerField is handled in exported Java
        }
 geometry Sphere { 
     radius 0.001
     }
}
DEF TestShape2 Shape { 
  appearance DEF TestAppearance2 Appearance { 
      material DEF ArtDeco02MaterialDEF ArtDeco02Material { name "ArtDeco02Material"

          description "ArtDeco02Material can substitute for another Material node"# [HelloWorldProgram diagnostic] ArtDeco02ProtoInstance.getNodeType()="ERROR_UNKNOWN_EXTERNPROTODECLARE_NODE_TYPE: ExternProtoDeclare name='ArtDeco02Material' type cannot be remotely accessed at run time. TODO X3DJSAIL needs to add further capability that retrieves the ExternProtoDeclare file."
                }
    # ArtDeco02Material prototype goes here... TODO ensure setContainerField is handled in exported Java
        }
 geometry Cone { 
     bottomRadius 0.001
     height 0.001
     }
}
DEF TestShape3 Shape { 
  appearance DEF TestAppearance3 Appearance { 
      material USE ArtDeco02MaterialDEF
        }
    # ArtDeco02Material ProtoInstance USE goes here...
        }
 geometry Cylinder { 
     height 0.001
     radius 0.001
     }
}
DEF inlineSceneDef Inline { 
 url [ "someOtherScene.x3d" ]
 }
IMPORT inlineSceneDef.WorldInfoDEF AS WorldInfoDEF2 
EXPORT WorldInfoDEF AS WorldInfoDEF3 
PROTO MaterialModulator [
   # [appinfo] "mimic a Material node and modulate fields as an animation effect"
  # [documentation] "http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter14Prototypes/MaterialModulatorIndex.html"
 
  # ProtoInterface
      inputOutput SFBool enabled true
      inputOutput SFColor diffuseColor 0 0 0
      inputOutput SFColor emissiveColor 0.05 0.05 0.5
      inputOutput SFColor specularColor 0 0 0
      inputOutput SFFloat transparency 0.0
      inputOutput SFFloat shininess 0.0
      inputOutput SFFloat ambientIntensity 0.0] {

  # ProtoBody
  DEF MaterialNode Material { 
      ambientIntensity IS ambientIntensity
      diffuseColor IS diffuseColor
      emissiveColor IS emissiveColor
      shininess IS shininess
      specularColor IS specularColor
      transparency IS transparency
     }
# Only first node (the node type) is renderable, others are along for the ride
    DEF MaterialModulatorScript Script { 
          inputOutput SFBool enabled
          inputOutput SFColor diffuseColor
          outputOnly SFColor newColor
          inputOnly SFTime clockTrigger      url [ "ecmascript:
function initialize ()
{
    newColor = diffuseColor; // start with correct color
}
function set_enabled (newValue)
{
	enabled = newValue;
}
function clockTrigger (timeValue)
{
    if (!enabled) return;
    red   = newColor.r;
    green = newColor.g;
    blue  = newColor.b;
    
    // note different modulation rates for each color component, % is modulus operator
    newColor = new SFColor ((red + 0.02) % 1, (green + 0.03) % 1, (blue + 0.04) % 1);
	if (enabled)
	{
		Browser.print ('diffuseColor=(' + red + ',' + green + ',' + blue + ') newColor=' + newColor.toString() + '\n');
	}
}
" ]
}
}
# Test success: declarative statement createDeclarativeShapeTests()
DEF DeclarativeGroupExample Group { 
   children [
  Shape { 
          appearance DEF DeclarativeAppearanceExample Appearance { 
              material DEF MyMaterialModulator MaterialModulator { name "MaterialModulator"
                }
            # DeclarativeMaterialExample gets overridden by subsequently added MaterialModulator ProtoInstance
                        }
         geometry Cone { 
             bottom false
             bottomRadius 0.05
             height 0.1
             }
         metadata DEF FindableMetadataStringTest MetadataString { 
             name "findThisNameValue"
             value [ "test case" ]
             }
        }
# Test success: declarativeGroup.addChild() singleton pipeline method
          ]
}
# Test success: declarative statement addChild()
# Test success: x3dModel.findNodeByDEF(DeclarativeAppearanceExample) = <Appearance DEF='DeclarativeAppearanceExample'/> i.e. <Appearance DEF='DeclarativeAppearanceExample'> <!-- DeclarativeMaterialExample gets overridden by subsequently added MaterialModulator ProtoInstance --> <ProtoInstance DEF='MyMaterialModulator' name='MaterialModulator' containerField='material'/> </Appearance>
# Test success: x3dModel.findElementByNameValue(findThisNameValue) = <MetadataString DEF='FindableMetadataStringTest' name='findThisNameValue' value='"test case"'/>
# Test success: x3dModel.findElementByNameValue("ArtDeco01Material", "ProtoDeclare") found
# Test success: x3dModel.findElementByNameValue("MaterialModulator", "ProtoDeclare") found
# Test success: x3dModel.findElementByNameValue("MaterialModulator", "ProtoInstance") found
DEF TestFieldObjectsGroup Group { 
   children [
  # testFieldObjects() results
        # SFBool default=true, true=true, false=false, negate()=true
        # MFBool default=, initial=true false true, negate()=false true false
        # SFFloat default=0.0, initial=1.0, setValue(2)=2.0, setValue(3.0f)=3.0, setValue(4.0)=4.0
        # MFFloat default=, initial=1 2 3, append(5)=1 2 3 5, inserts(3,4)(0,0)=0 1 2 3 4 5, append(6)=0 1 2 3 4 5 6, size()=7
        # ... get1Value[3]=3.0, remove[1]=0 2 3 4 5 6, set1Value(0,10)=10 2 3 4 5 6, multiply(2)=20 4 6 8 10 12, clear=
        # SFVec3f default=0 0 0, initial=1 2 3, setValue=4 5 6, multiply(2)=8 10 12, normalize()=0.45584232 0.5698029 0.68376344, regex matches()=true
        # regex test SFVec3f().matches("1 2 3")=true, regex test SFVec3f().matches("1 2 3 4")=false, regex test (SFRotationObject.matches("0 0 0 0")=true, failure detecting illegal (zero axis) rotation value
          ]
}
Sound { 
 location 0 1.6 0
  source AudioClip { 
     description "chimes"
     url [ "chimes.wav" "http://www.web3d.org/x3d/content/examples/ConformanceNist/Sounds/AudioClip/chimes.wav" ]
     # Scene example fragment from http://www.web3d.org/x3d/content/examples/ConformanceNist/Sounds/AudioClip/default.x3d
        }
# set sound-ellipsoid location height at 1.6m to match typical avatar height
}
Sound { 
 location 0 1.6 0
  source MovieTexture { 
     description "mpgsys.mpg from ConformanceNist suite"
     url [ "mpgsys.mpg" "http://www.web3d.org/x3d/content/examples/ConformanceNist/Appearance/MovieTexture/mpgsys.mpg" ]
     # Scene example fragment from http://www.web3d.org/x3d/content/examples/ConformanceNist/Appearance/MovieTexture/mpeg1-systems.x3d
    # Expected containerField='source', allowed containerField values="texture" "source" "back" "bottom" "front" "left" "right" "top" "backTexture" "bottomTexture" "frontTexture" "leftTexture" "rightTexture" "topTexture" "watchList"
        }
# set sound-ellipsoid location height at 1.6m to match typical avatar height
}
# Test success: AnchorObject.isNode()=true, siteAnchor.isNode()=true
# Test success: AnchorObject.isStatement()=false, siteAnchor.isStatement()=false
# Test success: ROUTEObject.isNode()=false, orbitPositionROUTE.isNode()=false
# Test success: ROUTEObject.isStatement()=true, orbitPositionROUTE.isStatement()=true
# Test success: CommentsBlock.isNode()=false, testComments.isNode()=false
# Test failure: CommentsBlock.isStatement()=true, testComments.isStatement()=true
DEF ExtrusionShape Shape { 
  appearance DEF TransparentAppearance Appearance { 
      material Material { 
         transparency 1.0
         }
    }
 geometry DEF ExampleExtrusion Extrusion { 
     }
# ExampleExtrusion isCrossSectionClosed()=true, crossSection='[1.0, 1.0, 1.0, -1.0, -1.0, -1.0, -1.0, 1.0, 1.0, 1.0]'
# ExampleExtrusion isSpineClosed()=false, spine='[0.0, 0.0, 0.0, 0.0, 1.0, 0.0]'
}

===========================================
x3dModel.toStringVRML97()

#VRML V2.0 utf8
#PROFILE Immersive
# head
#COMPONENT Navigation:3
#COMPONENT Layering:1
#UNIT angle AngleUnitConversion 1.0
#UNIT length LengthUnitConversion 1.0
#META "title" "HelloWorldProgramOutput.x3d"
#META "description" "Example HelloWorldProgram creates an X3D model using the X3D Java Scene Access Interface Library (X3DJSAIL)"
#META "reference" "http://www.web3d.org/specifications/java/X3DJSAIL.html"
#META "generator" "HelloWorldProgramOutput.java"
#META "created" "6 September 2016"
#META "modified" "14 October 2018"
#META "generator" "X3D Java Scene Access Interface Library (X3DJSAIL)"
#META "generator" "http://www.web3d.org/specifications/java/examples/HelloWorldProgram.java"
#META "generator" "Netbeans http://www.netbeans.org"
#META "creator" "Don Brutzman"
#META "reference" "https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/java/examples/HelloWorldProgramOutput.x3d"
#META "reference" "Console output, ClassicVRML encoding, VRML97 encoding and pretty-print documentation:"
#META "reference" "HelloWorldProgramOutput.txt"
#META "reference" "HelloWorldProgramOutput.x3dv"
#META "reference" "HelloWorldProgramOutput.wrl"
#META "reference" "HelloWorldProgramOutput.html"
#META "X3dValidator" "https://savage.nps.edu/X3dValidator?url=http://www.web3d.org/specifications/java/examples/HelloWorldProgramOutput.x3d"
#META "identifier" "http://www.web3d.org/specifications/java/examples/HelloWorldProgramOutput.x3d"
#META "license" "../license.html"
#META "SpecialTest" "tested sat: name value cannot contain embedded space character"
# comment #1
# comment #2
# comment #3
# comment #4
# Scene
ViewpointGroup { 
 description "Available viewpoints"
   children [
  DEF DefaultView Viewpoint { 
         description "Hello X3DJSAIL"
         }
DEF TopDownView Viewpoint { 
         description "top-down view from above"
         orientation 1 0 0 -1.570796
         position 0 100 0
         }
  ]
}
DEF WorldInfoDEF WorldInfo { 
 title "HelloWorldProgram produced by X3D Java SAI Library (X3DJSAIL)"
 }
USE WorldInfoDEF
USE WorldInfoDEF
DEF scene.addChildMetadata MetadataString { 
 name "test"
 value [ "Top-level root Metadata node beneath Scene needs to be one of &apos;-children&apos; in JSON encoding" ]
 }
DEF scene.addChildLayerSetTest LayerSet { 
 order [ 0 ]
 }
DEF LogoGeometryTransform Transform { 
 translation 0 1.5 0
   children [
  Anchor { 
         description "select for X3D Java SAI Library (X3DJSAIL) description"
         url [ "../X3DJSAIL.html" "http://www.web3d.org/specifications/java/X3DJSAIL.html" ]
           children [
          DEF BoxShape Shape { 
                  appearance Appearance { 
                      material DEF GreenMaterial Material { 
                         diffuseColor 0 1 1
                         emissiveColor 0.8 0 0
                         transparency 0.1
                         }
                     texture ImageTexture { 
                         url [ "images/X3dJavaSceneAccessInterfaceSaiLibrary.png" "http://www.web3d.org/specifications/java/examples/images/X3dJavaSceneAccessInterfaceSaiLibrary.png" ]
                         }
                    }
                 geometry DEF test-NMTOKEN_regex.0123456789 Box { 
                     # class "untextured"
                     }
                }
          ]
        }
  ]
}
DEF LineShape Shape { 
  appearance Appearance { 
      material Material { 
         emissiveColor 0.6 0.19607843 0.8
         }
    }
 geometry IndexedLineSet { 
     coordIndex [ 0 1 2 3 4 0 ]
      coord Coordinate { 
         point [ 0 1.5 0 2 1.5 0 2 1.5 -2 -2 1.5 -2 -2 1.5 0 0 1.5 0 ]
         }
    # Coordinate 3-tuple point count: 6
        }
}
DEF BoxPathAnimator PositionInterpolator { 
 key [ 0 0.125 0.375 0.625 0.875 1 ]
 keyValue [ 0 1.5 0 2 1.5 0 2 1.5 -2 -2 1.5 -2 -2 1.5 0 0 1.5 0 ]
 }
DEF OrbitClock TimeSensor { 
 cycleInterval 8.0
 loop true
 }
ROUTE OrbitClock.fraction_changed TO BoxPathAnimator.set_fraction
ROUTE BoxPathAnimator.value_changed TO LogoGeometryTransform.set_translation
DEF TextTransform Transform { 
 translation 0 -1.5 0
   children [
  Shape { 
          appearance Appearance { 
              material USE GreenMaterial
            }
         geometry Text { 
             string [ "X3D Java" "SAI Library" "X3DJSAIL" ]
              fontStyle FontStyle { 
                 }
             metadata MetadataSet { 
                 name "EscapedQuotationMarksMetadataSet"
                   value [
                  MetadataString { 
                         name "quotesTestC"
                         value [ "MFString example C, backslash-escaped quotes: He said, \"Immel did it!\"" ]
                         }
MetadataString { 
                         name "extraChildTest"
                         value [ "checks MetadataSetObject addValue() method" ]
                         }
                  ]
                }
            # Comment example A, plain quotation marks: He said, "Immel did it!"
            # Comment example B, XML character entities: He said, &quot;Immel did it!&quot;
                        }
        }
Collision { 
           children [
          # test containerField='proxy'
                          ]
         proxy DEF ProxyShape Shape { 
              geometry Text { 
                 string [ "One, Two, Text" "" "He said, \"Immel did it!\" \"\"" ]
                 }
            #  alternative XML encoding: Text string='"One, Two, Comment" "" "He said, \&quot;Immel did it!\&quot;"' 
            #  alternative XML encoding: Text string='"One, Two, Comment" "" "He said, \&quot;Immel did it!\&quot;" ""' 
            #  alternative Java source: .setString(new String [] {"One, Two, Comment", "", "He said, \"Immel did it!\""})
            #  reference: http://www.web3d.org/x3d/content/examples/Basic/X3dSpecifications/StringArrayEncodingExamplesIndex.html 
                        }
        }
# It's a beautiful world
        # ... for you!
        # https://en.wikipedia.org/wiki/Beautiful_World_(Devo_song)
          ]
}
# repeatedly spin 180 degrees as a readable special effect
DEF SpinInterpolator OrientationInterpolator { 
 keyValue [ 0 1 0 4.712389 0 1 0 0 0 1 0 1.5707964 ]
 }
DEF SpinClock TimeSensor { 
 cycleInterval 5.0
 loop true
 }
ROUTE SpinClock.fraction_changed TO SpinInterpolator.set_fraction
ROUTE SpinInterpolator.value_changed TO TextTransform.rotation
DEF BackgroundGroup Group { 
   children [
  DEF GradualBackground Background { 
         }
DEF colorTypeConversionScript Script { 
              inputOnly SFColor colorInput
              outputOnly MFColor colorsOutput          url [ "ecmascript:

function colorInput (eventValue) // Example source code
{
   colorsOutput = new MFColor(eventValue); // assigning value sends output event
// Browser.print('colorInput=' + eventValue + ', colorsOutput=' + colorsOutput + '\n');
}
" ]
}
DEF ColorAnimator ColorInterpolator { 
         keyValue [ 0.9411765 1 1 0.29411766 0 0.50980395 0.9411765 1 1 ]
         # AZURE to INDIGO and back again
                }
DEF ColorClock TimeSensor { 
         cycleInterval 60.0
         loop true
         }
ROUTE colorTypeConversionScript.colorsOutput TO GradualBackground.skyColor
        ROUTE ColorAnimator.value_changed TO colorTypeConversionScript.colorInput
        ROUTE ColorClock.fraction_changed TO ColorAnimator.set_fraction
          ]
}
PROTO ArtDeco01Material [
   # [appinfo] "tooltip: ArtDeco01Material prototype is a Material node"
  # ProtoInterface
      inputOutput SFString description "ArtDeco01Material prototype is a Material node" # [appinfo] "tooltip for descriptionField"
    
      inputOutput SFBool enabled true] {

  # ProtoBody
  # Initial node of ProtoBody determines prototype node type
    Material { 
     ambientIntensity 0.25
     diffuseColor 0.282435 0.085159 0.134462
     shininess 0.127273
     specularColor 0.276305 0.11431 0.139857
     }
# [HelloWorldProgram diagnostic] should be connected to scene graph: artDeco01ProtoDeclare.getNodeType()="Material"
    #  presence of follow-on TouchSensor shows that additional nodes are allowed in ProtoBody after initial node, regardless of node types
    TouchSensor { 
      description IS description
      enabled IS enabled
     }
}
EXTERNPROTO ArtDeco02Material [
   # [appinfo] "this is a different Material node"
 url [ "http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter14Prototypes/ArtDecoPrototypesExcerpt.x3d#ArtDeco02Material" "http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter14Prototypes/ArtDecoPrototypesExcerpt.x3dv#ArtDeco02Material" ]
  inputOutput SFString description # [appinfo] "tooltip for descriptionField"
# [HelloWorldProgram diagnostic] artDeco02ExternProtoDeclare.getNodeType()="ERROR_UNKNOWN_EXTERNPROTODECLARE_NODE_TYPE: ExternProtoDeclare name='ArtDeco02Material' type cannot be remotely accessed at run time. TODO X3DJSAIL needs to add further capability that retrieves the ExternProtoDeclare file."
]
# Tested ArtDeco01ProtoInstance, ArtDeco02ProtoInstance for improper node type when ProtoInstance is added in wrong place
DEF TestShape1 Shape { 
  appearance DEF TestAppearance1 Appearance { 
      material ArtDeco01Material { name "ArtDeco01Material"

          description "ArtDeco01Material can substitute for a Material node"# [HelloWorldProgram diagnostic] ArtDeco01ProtoInstance.getNodeType()="Material"
                }
    # ArtDeco01Material prototype goes here... TODO ensure setContainerField is handled in exported Java
        }
 geometry Sphere { 
     radius 0.001
     }
}
DEF TestShape2 Shape { 
  appearance DEF TestAppearance2 Appearance { 
      material DEF ArtDeco02MaterialDEF ArtDeco02Material { name "ArtDeco02Material"

          description "ArtDeco02Material can substitute for another Material node"# [HelloWorldProgram diagnostic] ArtDeco02ProtoInstance.getNodeType()="ERROR_UNKNOWN_EXTERNPROTODECLARE_NODE_TYPE: ExternProtoDeclare name='ArtDeco02Material' type cannot be remotely accessed at run time. TODO X3DJSAIL needs to add further capability that retrieves the ExternProtoDeclare file."
                }
    # ArtDeco02Material prototype goes here... TODO ensure setContainerField is handled in exported Java
        }
 geometry Cone { 
     bottomRadius 0.001
     height 0.001
     }
}
DEF TestShape3 Shape { 
  appearance DEF TestAppearance3 Appearance { 
      material USE ArtDeco02MaterialDEF
        }
    # ArtDeco02Material ProtoInstance USE goes here...
        }
 geometry Cylinder { 
     height 0.001
     radius 0.001
     }
}
DEF inlineSceneDef Inline { 
 url [ "someOtherScene.x3d" ]
 }
IMPORT inlineSceneDef.WorldInfoDEF AS WorldInfoDEF2 
EXPORT WorldInfoDEF AS WorldInfoDEF3 
PROTO MaterialModulator [
   # [appinfo] "mimic a Material node and modulate fields as an animation effect"
  # [documentation] "http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter14Prototypes/MaterialModulatorIndex.html"
 
  # ProtoInterface
      inputOutput SFBool enabled true
      inputOutput SFColor diffuseColor 0 0 0
      inputOutput SFColor emissiveColor 0.05 0.05 0.5
      inputOutput SFColor specularColor 0 0 0
      inputOutput SFFloat transparency 0.0
      inputOutput SFFloat shininess 0.0
      inputOutput SFFloat ambientIntensity 0.0] {

  # ProtoBody
  DEF MaterialNode Material { 
      ambientIntensity IS ambientIntensity
      diffuseColor IS diffuseColor
      emissiveColor IS emissiveColor
      shininess IS shininess
      specularColor IS specularColor
      transparency IS transparency
     }
# Only first node (the node type) is renderable, others are along for the ride
    DEF MaterialModulatorScript Script { 
          inputOutput SFBool enabled
          inputOutput SFColor diffuseColor
          outputOnly SFColor newColor
          inputOnly SFTime clockTrigger      url [ "ecmascript:
function initialize ()
{
    newColor = diffuseColor; // start with correct color
}
function set_enabled (newValue)
{
	enabled = newValue;
}
function clockTrigger (timeValue)
{
    if (!enabled) return;
    red   = newColor.r;
    green = newColor.g;
    blue  = newColor.b;
    
    // note different modulation rates for each color component, % is modulus operator
    newColor = new SFColor ((red + 0.02) % 1, (green + 0.03) % 1, (blue + 0.04) % 1);
	if (enabled)
	{
		Browser.print ('diffuseColor=(' + red + ',' + green + ',' + blue + ') newColor=' + newColor.toString() + '\n');
	}
}
" ]
}
}
# Test success: declarative statement createDeclarativeShapeTests()
DEF DeclarativeGroupExample Group { 
   children [
  Shape { 
          appearance DEF DeclarativeAppearanceExample Appearance { 
              material DEF MyMaterialModulator MaterialModulator { name "MaterialModulator"
                }
            # DeclarativeMaterialExample gets overridden by subsequently added MaterialModulator ProtoInstance
                        }
         geometry Cone { 
             bottom false
             bottomRadius 0.05
             height 0.1
             }
         metadata DEF FindableMetadataStringTest MetadataString { 
             name "findThisNameValue"
             value [ "test case" ]
             }
        }
# Test success: declarativeGroup.addChild() singleton pipeline method
          ]
}
# Test success: declarative statement addChild()
# Test success: x3dModel.findNodeByDEF(DeclarativeAppearanceExample) = <Appearance DEF='DeclarativeAppearanceExample'/> i.e. <Appearance DEF='DeclarativeAppearanceExample'> <!-- DeclarativeMaterialExample gets overridden by subsequently added MaterialModulator ProtoInstance --> <ProtoInstance DEF='MyMaterialModulator' name='MaterialModulator' containerField='material'/> </Appearance>
# Test success: x3dModel.findElementByNameValue(findThisNameValue) = <MetadataString DEF='FindableMetadataStringTest' name='findThisNameValue' value='"test case"'/>
# Test success: x3dModel.findElementByNameValue("ArtDeco01Material", "ProtoDeclare") found
# Test success: x3dModel.findElementByNameValue("MaterialModulator", "ProtoDeclare") found
# Test success: x3dModel.findElementByNameValue("MaterialModulator", "ProtoInstance") found
DEF TestFieldObjectsGroup Group { 
   children [
  # testFieldObjects() results
        # SFBool default=true, true=true, false=false, negate()=true
        # MFBool default=, initial=true false true, negate()=false true false
        # SFFloat default=0.0, initial=1.0, setValue(2)=2.0, setValue(3.0f)=3.0, setValue(4.0)=4.0
        # MFFloat default=, initial=1 2 3, append(5)=1 2 3 5, inserts(3,4)(0,0)=0 1 2 3 4 5, append(6)=0 1 2 3 4 5 6, size()=7
        # ... get1Value[3]=3.0, remove[1]=0 2 3 4 5 6, set1Value(0,10)=10 2 3 4 5 6, multiply(2)=20 4 6 8 10 12, clear=
        # SFVec3f default=0 0 0, initial=1 2 3, setValue=4 5 6, multiply(2)=8 10 12, normalize()=0.45584232 0.5698029 0.68376344, regex matches()=true
        # regex test SFVec3f().matches("1 2 3")=true, regex test SFVec3f().matches("1 2 3 4")=false, regex test (SFRotationObject.matches("0 0 0 0")=true, failure detecting illegal (zero axis) rotation value
          ]
}
Sound { 
 location 0 1.6 0
  source AudioClip { 
     description "chimes"
     url [ "chimes.wav" "http://www.web3d.org/x3d/content/examples/ConformanceNist/Sounds/AudioClip/chimes.wav" ]
     # Scene example fragment from http://www.web3d.org/x3d/content/examples/ConformanceNist/Sounds/AudioClip/default.x3d
        }
# set sound-ellipsoid location height at 1.6m to match typical avatar height
}
Sound { 
 location 0 1.6 0
  source MovieTexture { 
     description "mpgsys.mpg from ConformanceNist suite"
     url [ "mpgsys.mpg" "http://www.web3d.org/x3d/content/examples/ConformanceNist/Appearance/MovieTexture/mpgsys.mpg" ]
     # Scene example fragment from http://www.web3d.org/x3d/content/examples/ConformanceNist/Appearance/MovieTexture/mpeg1-systems.x3d
    # Expected containerField='source', allowed containerField values="texture" "source" "back" "bottom" "front" "left" "right" "top" "backTexture" "bottomTexture" "frontTexture" "leftTexture" "rightTexture" "topTexture" "watchList"
        }
# set sound-ellipsoid location height at 1.6m to match typical avatar height
}
# Test success: AnchorObject.isNode()=true, siteAnchor.isNode()=true
# Test success: AnchorObject.isStatement()=false, siteAnchor.isStatement()=false
# Test success: ROUTEObject.isNode()=false, orbitPositionROUTE.isNode()=false
# Test success: ROUTEObject.isStatement()=true, orbitPositionROUTE.isStatement()=true
# Test success: CommentsBlock.isNode()=false, testComments.isNode()=false
# Test failure: CommentsBlock.isStatement()=true, testComments.isStatement()=true
DEF ExtrusionShape Shape { 
  appearance DEF TransparentAppearance Appearance { 
      material Material { 
         transparency 1.0
         }
    }
 geometry DEF ExampleExtrusion Extrusion { 
     }
# ExampleExtrusion isCrossSectionClosed()=true, crossSection='[1.0, 1.0, 1.0, -1.0, -1.0, -1.0, -1.0, 1.0, 1.0, 1.0]'
# ExampleExtrusion isSpineClosed()=false, spine='[0.0, 0.0, 0.0, 0.0, 1.0, 0.0]'
}

===========================================
Create .x3d (X3D XML Encoding) version of model
Warning: toFileX3D() is overwriting prior file HelloWorldProgramOutput.x3d
helloWorldObject.toFileX3D("HelloWorldProgramOutput.x3d") success: true
C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples\HelloWorldProgramOutput.x3d
===========================================
Create .xml (X3D XML Encoding) version of model
Warning: toFileX3D() is overwriting prior file HelloWorldProgramOutput.xml
helloWorldObject.toFileXML("HelloWorldProgramOutput.xml") success: true
C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples\HelloWorldProgramOutput.xml
===========================================
Create pretty-print .html documentation of model
Warning: toFileStylesheetConversion(X3dExtrusionToSvgViaXslt1.1.xslt) is overwriting prior file HelloWorldProgramOutput.svg
Warning: toFileStylesheetConversion(X3dToXhtml.xslt) is overwriting prior file HelloWorldProgramOutput.html
helloWorldObject.toFileHtmlDocumentation("HelloWorldProgramOutput.html") success: true
C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples\HelloWorldProgramOutput.html
===========================================
Create .x3d (X3D XML Encoding) cleaned-up version of model using X3D Tidy
Warning: toFileStylesheetConversion(X3dTidy.xslt) is overwriting prior file HelloWorldProgramOutputTidy.x3d
*** revision: &lt;meta name='modified' content='14 October 2018'/&gt;
  &lt;Inline DEF='inlineSceneDef'&gt;
    original url='"someOtherScene.x3d"'
*** revision  url='"someOtherScene.x3d" "http://www.web3d.org/specifications/java/examples/someOtherScene.x3d" "someOtherScene.wrl" "http://www.web3d.org/specifications/java/examples/someOtherScene.wrl"'
helloWorldObject.toFileX3dTidy("HelloWorldProgramOutputTidy.x3d") success: true
C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples\HelloWorldProgramOutputTidy.x3d
===========================================
Create .md (Markdown) file for model meta information using X3dModelMetaToMarkdown.xslt
Warning: toFileStylesheetConversion(X3dModelMetaToMarkdown.xslt) is overwriting prior file HelloWorldProgramOutput.md
helloWorldObject.toFileModelMetaMarkdown("HelloWorldProgramOutput.md") success: true
C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples\HelloWorldProgramOutput.md
===========================================
Create X3D ClassicVRML Encoding of model
Warning: toFileClassicVRML() is overwriting prior file HelloWorldProgramOutput.x3dv
helloWorldObject.toFileClassicVRML("HelloWorldProgramOutput.x3dv") success: true
C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples\HelloWorldProgramOutput.x3dv
===========================================
Create VRML97 Encoding of model
Warning: toFileVRML97() is overwriting prior file HelloWorldProgramOutput.wrl
helloWorldObject.toFileVRML97("HelloWorldProgramOutput.wrl") success: true
C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples\HelloWorldProgramOutput.wrl
===========================================
Create pretty-print HTML documentation of model using ConfigurationProperties.getXsltEngine()=SAXON9HE and stylesheet X3dToXhtml.xslt
Warning: toFileStylesheetConversion(X3dExtrusionToSvgViaXslt1.1.xslt) is overwriting prior file HelloWorldProgramOutput.svg
Warning: toFileStylesheetConversion(X3dToXhtml.xslt) is overwriting prior file HelloWorldProgramOutput.html
helloWorldObject.toFileHtmlDocumentation("HelloWorldProgramOutput.html") success: true
C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples\HelloWorldProgramOutput.html
===========================================
Create concise Java source of model using stylesheet X3dToJava.xslt
Warning: toFileStylesheetConversion(X3dToJava.xslt) is overwriting prior file HelloWorldProgramOutput.java
helloWorldObject.toFileJava("HelloWorldProgramOutput.java") success: true
C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples\HelloWorldProgramOutput.java
Test toStringJava()

import java.util.*;
import org.web3d.x3d.jsail.Core.*;
import org.web3d.x3d.jsail.EnvironmentalEffects.*;
import org.web3d.x3d.jsail.fields.*;
import org.web3d.x3d.jsail.Geometry3D.*;
import org.web3d.x3d.jsail.Grouping.*;
import org.web3d.x3d.jsail.Interpolation.*;
import org.web3d.x3d.jsail.Layering.*;
import org.web3d.x3d.jsail.Navigation.*;
import org.web3d.x3d.jsail.Networking.*;
import org.web3d.x3d.jsail.PointingDeviceSensor.*;
import org.web3d.x3d.jsail.Rendering.*;
import org.web3d.x3d.jsail.Scripting.*;
import org.web3d.x3d.jsail.Shape.*;
import org.web3d.x3d.jsail.Sound.*;
import org.web3d.x3d.jsail.Text.*;
import org.web3d.x3d.jsail.Texturing.*;
import org.web3d.x3d.jsail.Time.*;

// Javadoc annotations follow, see below for source.
/**
 * <p> Example HelloWorldProgram creates an X3D model using the X3D Java Scene Access Interface Library (X3DJSAIL). </p>
 <p> Related links: temporaryJavaOutputFile.java source, <a href="http://www.web3d.org/x3d/content/examples/X3dResources.html" target="_blank">X3D Resources</a>, <a href="http://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html" target="_blank">X3D Scene Authoring Hints</a>, and <a href="http://www.web3d.org/x3d/content/X3dTooltips.html" target="_blank">X3D Tooltips</a>. </p>
	<table style="color:black; border:0px solid; border-spacing:10px 0px;" summary="Scene Metadata">
		<tr style="background-color:silver; border-color:silver;">
			<td style="text-align:center; padding:10px 0px;"><i>meta tags</i></td>
			<td style="text-align:left;   padding:10px 0px;">temporaryJavaOutputFile&nbsp; Document Metadata </td>
		</tr>

		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> title </i> </td>
			<td> <a href="http://www.web3d.org/specifications/java/examples/HelloWorldProgramOutput.x3d">HelloWorldProgramOutput.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> description </i> </td>
			<td> Example HelloWorldProgram creates an X3D model using the X3D Java Scene Access Interface Library (X3DJSAIL) </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="http://www.web3d.org/specifications/java/X3DJSAIL.html" target="_blank">http://www.web3d.org/specifications/java/X3DJSAIL.html</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> generator </i> </td>
			<td> HelloWorldProgramOutput.java </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> created </i> </td>
			<td> 6 September 2016 </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> modified </i> </td>
			<td> 14 October 2018 </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> generator </i> </td>
			<td> X3D Java Scene Access Interface Library (X3DJSAIL) </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> generator </i> </td>
			<td> <a href="http://www.web3d.org/specifications/java/examples/HelloWorldProgram.java" target="_blank">http://www.web3d.org/specifications/java/examples/HelloWorldProgram.java</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> generator </i> </td>
			<td> Netbeans <a href="http://www.netbeans.org" target="_blank">http://www.netbeans.org</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> creator </i> </td>
			<td> Don Brutzman </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/java/examples/HelloWorldProgramOutput.x3d" target="_blank">https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/java/examples/HelloWorldProgramOutput.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> Console output, ClassicVRML encoding, VRML97 encoding and pretty-print documentation: </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> HelloWorldProgramOutput.txt </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="http://www.web3d.org/specifications/java/examples/HelloWorldProgramOutput.x3dv">HelloWorldProgramOutput.x3dv</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> HelloWorldProgramOutput.wrl </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="http://www.web3d.org/specifications/java/examples/HelloWorldProgramOutput.html">HelloWorldProgramOutput.html</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> X3dValidator </i> </td>
			<td> <a href="https://savage.nps.edu/X3dValidator?url=http://www.web3d.org/specifications/java/examples/HelloWorldProgramOutput.x3d" target="_blank">https://savage.nps.edu/X3dValidator?url=http://www.web3d.org/specifications/java/examples/HelloWorldProgramOutput.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> identifier </i> </td>
			<td> <a href="http://www.web3d.org/specifications/java/examples/HelloWorldProgramOutput.x3d" target="_blank">http://www.web3d.org/specifications/java/examples/HelloWorldProgramOutput.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> license </i> </td>
			<td> <a href="http://www.web3d.org/specifications/java/examples/../license.html">../license.html</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> SpecialTest </i> </td>
			<td> tested sat: name value cannot contain embedded space character </td>
		</tr>
		<tr style="background-color:silver; border-color:silver;">
			<td style="text-align:center;" colspan="2">  &nbsp; </td>
		</tr>
	</table>

	<p>
		This program uses the
		<a href="http://www.web3d.org/specifications/java/X3DJSAIL.html" target="_blank">X3D Java Scene Access Interface Library (X3DJSAIL)</a>.
		It has been produced using the 
		<a href="http://www.web3d.org/x3d/stylesheets/X3dToJava.xslt" target="_blank">X3dToJava.xslt</a>
		stylesheet to create Java source code from an <code>.x3d</code> model.
	</p>

	* @author Don Brutzman
 */

public class temporaryJavaOutputFile
{
	/** Default constructor to create this object. */
	public temporaryJavaOutputFile ()
	{
	  initialize();
	}

	/** Create and initialize the X3D model for this object. */
	public final void initialize()
	{
  x3dModel = new X3DObject().setProfile(X3DObject.PROFILE_IMMERSIVE).setVersion(X3DObject.VERSION_3_3)
  .setHead(new headObject()
    .addComments(" comment #1 ")
    .addComments(" comment #2 ")
    .addComments(" comment #3 ")
    .addComments(" comment #4 ")
    .addComponent(new componentObject().setName("Navigation").setLevel(3))
    .addComponent(new componentObject().setName("Layering").setLevel(1))
    .addUnit(new unitObject().setName("AngleUnitConversion").setCategory("angle").setConversionFactor(1.0))
    .addUnit(new unitObject().setName("LengthUnitConversion").setCategory("length").setConversionFactor(1.0))
    .addMeta(new metaObject().setName(metaObject.NAME_TITLE      ).setContent("HelloWorldProgramOutput.x3d"))
    .addMeta(new metaObject().setName(metaObject.NAME_DESCRIPTION).setContent("Example HelloWorldProgram creates an X3D model using the X3D Java Scene Access Interface Library (X3DJSAIL)"))
    .addMeta(new metaObject().setName(metaObject.NAME_REFERENCE  ).setContent("http://www.web3d.org/specifications/java/X3DJSAIL.html"))
    .addMeta(new metaObject().setName(metaObject.NAME_GENERATOR  ).setContent("HelloWorldProgramOutput.java"))
    .addMeta(new metaObject().setName(metaObject.NAME_CREATED    ).setContent("6 September 2016"))
    .addMeta(new metaObject().setName(metaObject.NAME_MODIFIED   ).setContent("14 October 2018"))
    .addMeta(new metaObject().setName(metaObject.NAME_GENERATOR  ).setContent("X3D Java Scene Access Interface Library (X3DJSAIL)"))
    .addMeta(new metaObject().setName(metaObject.NAME_GENERATOR  ).setContent("http://www.web3d.org/specifications/java/examples/HelloWorldProgram.java"))
    .addMeta(new metaObject().setName(metaObject.NAME_GENERATOR  ).setContent("Netbeans http://www.netbeans.org"))
    .addMeta(new metaObject().setName(metaObject.NAME_CREATOR    ).setContent("Don Brutzman"))
    .addMeta(new metaObject().setName(metaObject.NAME_REFERENCE  ).setContent("https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/java/examples/HelloWorldProgramOutput.x3d"))
    .addMeta(new metaObject().setName(metaObject.NAME_REFERENCE  ).setContent("Console output, ClassicVRML encoding, VRML97 encoding and pretty-print documentation:"))
    .addMeta(new metaObject().setName(metaObject.NAME_REFERENCE  ).setContent("HelloWorldProgramOutput.txt"))
    .addMeta(new metaObject().setName(metaObject.NAME_REFERENCE  ).setContent("HelloWorldProgramOutput.x3dv"))
    .addMeta(new metaObject().setName(metaObject.NAME_REFERENCE  ).setContent("HelloWorldProgramOutput.wrl"))
    .addMeta(new metaObject().setName(metaObject.NAME_REFERENCE  ).setContent("HelloWorldProgramOutput.html"))
    .addMeta(new metaObject().setName("X3dValidator").setContent("https://savage.nps.edu/X3dValidator?url=http://www.web3d.org/specifications/java/examples/HelloWorldProgramOutput.x3d"))
    .addMeta(new metaObject().setName(metaObject.NAME_IDENTIFIER ).setContent("http://www.web3d.org/specifications/java/examples/HelloWorldProgramOutput.x3d"))
    .addMeta(new metaObject().setName(metaObject.NAME_LICENSE    ).setContent("../license.html"))
    .addMeta(new metaObject().setName("SpecialTest").setContent("tested sat: name value cannot contain embedded space character")))
  .setScene(new SceneObject()
    .addChild(new ViewpointGroupObject().setDescription("Available viewpoints")
      .addChild(new ViewpointObject("DefaultView").setDescription("Hello X3DJSAIL"))
      .addChild(new ViewpointObject("TopDownView").setDescription("top-down view from above").setOrientation(1.0f,0.0f,0.0f,-1.570796f).setPosition(0.0f,100.0f,0.0f)))
    .addChild(new WorldInfoObject("WorldInfoDEF").setTitle("HelloWorldProgram produced by X3D Java SAI Library (X3DJSAIL)"))
    .addChild(new WorldInfoObject().setUSE("WorldInfoDEF"))
    .addChild(new WorldInfoObject().setUSE("WorldInfoDEF"))
    .addMetadata(new MetadataStringObject("scene.addChildMetadata").setName("test").setValue(new MFStringObject("\"Top-level root Metadata node beneath Scene needs to be one of '-children' in JSON encoding\"")))
    .addLayerSet(new LayerSetObject("scene.addChildLayerSetTest"))
    .addChild(new TransformObject("LogoGeometryTransform").setTranslation(0.0f,1.5f,0.0f)
      .addChild(new AnchorObject().setDescription("select for X3D Java SAI Library (X3DJSAIL) description").setUrl(new MFStringObject("\"../X3DJSAIL.html\" \"http://www.web3d.org/specifications/java/X3DJSAIL.html\""))
        .addChild(new ShapeObject("BoxShape")
          .setAppearance(new AppearanceObject()
            .setMaterial(new MaterialObject("GreenMaterial").setDiffuseColor(0.0f,1.0f,1.0f).setEmissiveColor(0.8f,0.0f,0.0f).setTransparency(0.1f))
            .setTexture(new ImageTextureObject().setUrl(new MFStringObject("\"images/X3dJavaSceneAccessInterfaceSaiLibrary.png\" \"http://www.web3d.org/specifications/java/examples/images/X3dJavaSceneAccessInterfaceSaiLibrary.png\""))))
          .setGeometry(new BoxObject("test-NMTOKEN_regex.0123456789").setCssClass("untextured")))))
    .addChild(new ShapeObject("LineShape")
      .setAppearance(new AppearanceObject()
        .setMaterial(new MaterialObject().setEmissiveColor(0.6f,0.19607843f,0.8f)))
      .setGeometry(new IndexedLineSetObject().setCoordIndex(new int[] {0,1,2,3,4,0})
        .addComments(" Coordinate 3-tuple point count: 6 ")
        .setCoord(new CoordinateObject().setPoint(new MFVec3fObject(new float[] {0.0f,1.5f,0.0f,2.0f,1.5f,0.0f,2.0f,1.5f,-2.0f,-2.0f,1.5f,-2.0f,-2.0f,1.5f,0.0f,0.0f,1.5f,0.0f})))))
    .addChild(new PositionInterpolatorObject("BoxPathAnimator").setKey(new float[] {0.0f,0.125f,0.375f,0.625f,0.875f,1.0f}).setKeyValue(new MFVec3fObject(new float[] {0.0f,1.5f,0.0f,2.0f,1.5f,0.0f,2.0f,1.5f,-2.0f,-2.0f,1.5f,-2.0f,-2.0f,1.5f,0.0f,0.0f,1.5f,0.0f})))
    .addChild(new TimeSensorObject("OrbitClock").setCycleInterval(8.0).setLoop(true))
    .addChild(new ROUTEObject().setFromNode("OrbitClock").setFromField("fraction_changed").setToNode("BoxPathAnimator").setToField("set_fraction"))
    .addChild(new ROUTEObject().setFromNode("BoxPathAnimator").setFromField("value_changed").setToNode("LogoGeometryTransform").setToField("set_translation"))
    .addChild(new TransformObject("TextTransform").setTranslation(0.0f,-1.5f,0.0f)
      .addChild(new ShapeObject()
        .setAppearance(new AppearanceObject()
          .setMaterial(new MaterialObject().setUSE("GreenMaterial")))
        .setGeometry(new TextObject().setString(new MFStringObject("\"X3D Java\" \"SAI Library\" \"X3DJSAIL\""))
          .addComments(" Comment example A, plain quotation marks: He said, \"Immel did it!\" ")
          .addComments(" Comment example B, XML character entities: He said, &quot;Immel did it!&quot; ")
          .setMetadata(new MetadataSetObject().setName("EscapedQuotationMarksMetadataSet")
            .addValue(new MetadataStringObject().setName("quotesTestC").setValue(new MFStringObject("\"MFString example C, backslash-escaped quotes: He said, \\\"Immel did it!\\\"\"")))
            .addValue(new MetadataStringObject().setName("extraChildTest").setValue(new MFStringObject("\"checks MetadataSetObject addValue() method\""))))
          .setFontStyle(new FontStyleObject())))
      .addChild(new CollisionObject()
        .addComments(" test containerField='proxy' ")
        .setProxy(new ShapeObject("ProxyShape")
          .addComments(" alternative XML encoding: Text string='\"One, Two, Comment\" \"\" \"He said, \\&quot;Immel did it!\\&quot;\"' ")
          .addComments(" alternative XML encoding: Text string='\"One, Two, Comment\" \"\" \"He said, \\&quot;Immel did it!\\&quot;\" \"\"' ")
          .addComments(" alternative Java source: .setString(new String [] {\"One, Two, Comment\", \"\", \"He said, \\\"Immel did it!\\\"\"}) ")
          .addComments(" reference: http://www.web3d.org/x3d/content/examples/Basic/X3dSpecifications/StringArrayEncodingExamplesIndex.html ")
          .setGeometry(new TextObject().setString(new MFStringObject("\"One, Two, Text\" \"\" \"He said, \\\"Immel did it!\\\" \\\"\\\"\"")))))
      .addComments(" It's a beautiful world ")
      .addComments(" ... for you! ")
      .addComments(" https://en.wikipedia.org/wiki/Beautiful_World_(Devo_song) "))
    .addComments(" repeatedly spin 180 degrees as a readable special effect ")
    .addChild(new OrientationInterpolatorObject("SpinInterpolator").setKeyValue(new MFRotationObject(new float[] {0.0f,1.0f,0.0f,4.712389f,0.0f,1.0f,0.0f,0.0f,0.0f,1.0f,0.0f,1.5707964f})))
    .addChild(new TimeSensorObject("SpinClock").setCycleInterval(5.0).setLoop(true))
    .addChild(new ROUTEObject().setFromNode("SpinClock").setFromField("fraction_changed").setToNode("SpinInterpolator").setToField("set_fraction"))
    .addChild(new ROUTEObject().setFromNode("SpinInterpolator").setFromField("value_changed").setToNode("TextTransform").setToField("rotation"))
    .addChild(new GroupObject("BackgroundGroup")
      .addChild(new BackgroundObject("GradualBackground"))
      .addChild(new ScriptObject("colorTypeConversionScript").setSourceCode("\n" + 
"\n" + 
"ecmascript:" + "\n" + 
"\n" + 
"function colorInput (eventValue) // Example source code" + "\n" + 
"{" + "\n" + 
"   colorsOutput = new MFColor(eventValue); // assigning value sends output event" + "\n" + 
"// Browser.print('colorInput=' + eventValue + ', colorsOutput=' + colorsOutput + '\\n');" + "\n" + 
"}" + "\n")
        .addField(new fieldObject().setName("colorInput").setType(fieldObject.TYPE_SFCOLOR).setAccessType(fieldObject.ACCESSTYPE_INPUTONLY))
        .addField(new fieldObject().setName("colorsOutput").setType(fieldObject.TYPE_MFCOLOR).setAccessType(fieldObject.ACCESSTYPE_OUTPUTONLY)))
      .addChild(new ColorInterpolatorObject("ColorAnimator").setKeyValue(new MFColorObject(new float[] {0.9411765f,1.0f,1.0f,0.29411766f,0.0f,0.50980395f,0.9411765f,1.0f,1.0f}))
        .addComments(" AZURE to INDIGO and back again "))
      .addChild(new TimeSensorObject("ColorClock").setCycleInterval(60.0).setLoop(true))
      .addChild(new ROUTEObject().setFromNode("colorTypeConversionScript").setFromField("colorsOutput").setToNode("GradualBackground").setToField("skyColor"))
      .addChild(new ROUTEObject().setFromNode("ColorAnimator").setFromField("value_changed").setToNode("colorTypeConversionScript").setToField("colorInput"))
      .addChild(new ROUTEObject().setFromNode("ColorClock").setFromField("fraction_changed").setToNode("ColorAnimator").setToField("set_fraction")))
    .addChild(new ProtoDeclareObject().setName("ArtDeco01Material").setAppinfo("tooltip: ArtDeco01Material prototype is a Material node")
      .setProtoInterface(new ProtoInterfaceObject()
        .addField(new fieldObject().setName("description").setType(fieldObject.TYPE_SFSTRING).setAccessType(fieldObject.ACCESSTYPE_INPUTOUTPUT).setValue("ArtDeco01Material prototype is a Material node").setAppinfo("tooltip for descriptionField"))
        .addField(new fieldObject().setName("enabled").setType(fieldObject.TYPE_SFBOOL).setAccessType(fieldObject.ACCESSTYPE_INPUTOUTPUT).setValue(true)))
      .setProtoBody(new ProtoBodyObject()
        .addComments(" Initial node of ProtoBody determines prototype node type ")
        .addChild(new MaterialObject().setAmbientIntensity(0.25f).setDiffuseColor(0.282435f,0.085159f,0.134462f).setShininess(0.127273f).setSpecularColor(0.276305f,0.11431f,0.139857f))
        .addComments(" [HelloWorldProgram diagnostic] should be connected to scene graph: artDeco01ProtoDeclare.getNodeType()=\"Material\" ")
        .addComments(" presence of follow-on TouchSensor shows that additional nodes are allowed in ProtoBody after initial node, regardless of node types ")
        .addChild(new TouchSensorObject().setDescription("within ProtoBody")
          .setIS(new ISObject()
            .addConnect(new connectObject().setNodeField("description").setProtoField("description"))
            .addConnect(new connectObject().setNodeField("enabled").setProtoField("enabled"))))))
    .addChild(new ExternProtoDeclareObject().setName("ArtDeco02Material").setAppinfo("this is a different Material node").setUrl(new MFStringObject("\"http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter14Prototypes/ArtDecoPrototypesExcerpt.x3d#ArtDeco02Material\" \"http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter14Prototypes/ArtDecoPrototypesExcerpt.x3dv#ArtDeco02Material\""))
      .addComments(" [HelloWorldProgram diagnostic] artDeco02ExternProtoDeclare.getNodeType()=\"ERROR_UNKNOWN_EXTERNPROTODECLARE_NODE_TYPE: ExternProtoDeclare name='ArtDeco02Material' type cannot be remotely accessed at run time. TODO X3DJSAIL needs to add further capability that retrieves the ExternProtoDeclare file.\" ")
      .addField(new fieldObject().setName("description").setType(fieldObject.TYPE_SFSTRING).setAccessType(fieldObject.ACCESSTYPE_INPUTOUTPUT).setAppinfo("tooltip for descriptionField")))
    .addComments(" Tested ArtDeco01ProtoInstance, ArtDeco02ProtoInstance for improper node type when ProtoInstance is added in wrong place ")
    .addChild(new ShapeObject("TestShape1")
      .setAppearance(new AppearanceObject("TestAppearance1")
        .addComments(" ArtDeco01Material prototype goes here... TODO ensure setContainerField is handled in exported Java ")
        .setMaterial(new ProtoInstanceObject().setName("ArtDeco01Material")
          .addComments(" [HelloWorldProgram diagnostic] ArtDeco01ProtoInstance.getNodeType()=\"Material\" ")
          .addFieldValue(new fieldValueObject().setName("description").setValue("ArtDeco01Material can substitute for a Material node"))))
      .setGeometry(new SphereObject().setRadius(0.001f)))
    .addChild(new ShapeObject("TestShape2")
      .setAppearance(new AppearanceObject("TestAppearance2")
        .addComments(" ArtDeco02Material prototype goes here... TODO ensure setContainerField is handled in exported Java ")
        .setMaterial(new ProtoInstanceObject("ArtDeco02MaterialDEF", "ArtDeco02Material").setDEF("ArtDeco02MaterialDEF").setName("ArtDeco02Material")
          .addComments(" [HelloWorldProgram diagnostic] ArtDeco02ProtoInstance.getNodeType()=\"ERROR_UNKNOWN_EXTERNPROTODECLARE_NODE_TYPE: ExternProtoDeclare name='ArtDeco02Material' type cannot be remotely accessed at run time. TODO X3DJSAIL needs to add further capability that retrieves the ExternProtoDeclare file.\" ")
          .addFieldValue(new fieldValueObject().setName("description").setValue("ArtDeco02Material can substitute for another Material node"))))
      .setGeometry(new ConeObject().setBottomRadius(0.001f).setHeight(0.001f)))
    .addChild(new ShapeObject("TestShape3")
      .setAppearance(new AppearanceObject("TestAppearance3")
        .addComments(" ArtDeco02Material ProtoInstance USE goes here... ")
        .setMaterial(new ProtoInstanceObject().setUSE("ArtDeco02MaterialDEF")))
      .setGeometry(new CylinderObject().setHeight(0.001f).setRadius(0.001f)))
    .addChild(new InlineObject("inlineSceneDef").setUrl(new MFStringObject("\"someOtherScene.x3d\"")))
    .addChild(new IMPORTObject().setImportedDEF("WorldInfoDEF").setInlineDEF("inlineSceneDef").setAS("WorldInfoDEF2"))
    .addChild(new EXPORTObject().setLocalDEF("WorldInfoDEF").setAS("WorldInfoDEF3"))
    .addChild(new ProtoDeclareObject().setName("MaterialModulator").setAppinfo("mimic a Material node and modulate fields as an animation effect").setDocumentation("http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter14Prototypes/MaterialModulatorIndex.html")
      .setProtoInterface(new ProtoInterfaceObject()
        .addField(new fieldObject().setName("enabled").setType(fieldObject.TYPE_SFBOOL).setAccessType(fieldObject.ACCESSTYPE_INPUTOUTPUT).setValue(true))
        .addField(new fieldObject().setName("diffuseColor").setType(fieldObject.TYPE_SFCOLOR).setAccessType(fieldObject.ACCESSTYPE_INPUTOUTPUT).setValue(new SFColorObject(0.0f,0.0f,0.0f)))
        .addField(new fieldObject().setName("emissiveColor").setType(fieldObject.TYPE_SFCOLOR).setAccessType(fieldObject.ACCESSTYPE_INPUTOUTPUT).setValue(new SFColorObject(0.05f,0.05f,0.5f)))
        .addField(new fieldObject().setName("specularColor").setType(fieldObject.TYPE_SFCOLOR).setAccessType(fieldObject.ACCESSTYPE_INPUTOUTPUT).setValue(new SFColorObject(0.0f,0.0f,0.0f)))
        .addField(new fieldObject().setName("transparency").setType(fieldObject.TYPE_SFFLOAT).setAccessType(fieldObject.ACCESSTYPE_INPUTOUTPUT).setValue(0.0f))
        .addField(new fieldObject().setName("shininess").setType(fieldObject.TYPE_SFFLOAT).setAccessType(fieldObject.ACCESSTYPE_INPUTOUTPUT).setValue(0.0f))
        .addField(new fieldObject().setName("ambientIntensity").setType(fieldObject.TYPE_SFFLOAT).setAccessType(fieldObject.ACCESSTYPE_INPUTOUTPUT).setValue(0.0f)))
      .setProtoBody(new ProtoBodyObject()
        .addChild(new MaterialObject("MaterialNode")
          .setIS(new ISObject()
            .addConnect(new connectObject().setNodeField("diffuseColor").setProtoField("diffuseColor"))
            .addConnect(new connectObject().setNodeField("emissiveColor").setProtoField("emissiveColor"))
            .addConnect(new connectObject().setNodeField("specularColor").setProtoField("specularColor"))
            .addConnect(new connectObject().setNodeField("transparency").setProtoField("transparency"))
            .addConnect(new connectObject().setNodeField("shininess").setProtoField("shininess"))
            .addConnect(new connectObject().setNodeField("ambientIntensity").setProtoField("ambientIntensity"))))
        .addComments(" Only first node (the node type) is renderable, others are along for the ride ")
        .addChild(new ScriptObject("MaterialModulatorScript").setSourceCode("\n" + 
"\n" + 
"ecmascript:" + "\n" + 
"function initialize ()" + "\n" + 
"{" + "\n" + 
"    newColor = diffuseColor; // start with correct color" + "\n" + 
"}" + "\n" + 
"function set_enabled (newValue)" + "\n" + 
"{" + "\n" + 
"	enabled = newValue;" + "\n" + 
"}" + "\n" + 
"function clockTrigger (timeValue)" + "\n" + 
"{" + "\n" + 
"    if (!enabled) return;" + "\n" + 
"    red   = newColor.r;" + "\n" + 
"    green = newColor.g;" + "\n" + 
"    blue  = newColor.b;" + "\n" + 
"    " + "\n" + 
"    // note different modulation rates for each color component, % is modulus operator" + "\n" + 
"    newColor = new SFColor ((red + 0.02) % 1, (green + 0.03) % 1, (blue + 0.04) % 1);" + "\n" + 
"	if (enabled)" + "\n" + 
"	{" + "\n" + 
"		Browser.print ('diffuseColor=(' + red + ',' + green + ',' + blue + ') newColor=' + newColor.toString() + '\\n');" + "\n" + 
"	}" + "\n" + 
"}" + "\n")
          .addField(new fieldObject().setName("enabled").setType(fieldObject.TYPE_SFBOOL).setAccessType(fieldObject.ACCESSTYPE_INPUTOUTPUT))
          .addField(new fieldObject().setName("diffuseColor").setType(fieldObject.TYPE_SFCOLOR).setAccessType(fieldObject.ACCESSTYPE_INPUTOUTPUT))
          .addField(new fieldObject().setName("newColor").setType(fieldObject.TYPE_SFCOLOR).setAccessType(fieldObject.ACCESSTYPE_OUTPUTONLY))
          .addField(new fieldObject().setName("clockTrigger").setType(fieldObject.TYPE_SFTIME).setAccessType(fieldObject.ACCESSTYPE_INPUTONLY))
          .setIS(new ISObject()
            .addConnect(new connectObject().setNodeField("enabled").setProtoField("enabled"))
            .addConnect(new connectObject().setNodeField("diffuseColor").setProtoField("diffuseColor"))))))
    .addComments(" Test success: declarative statement createDeclarativeShapeTests() ")
    .addChild(new GroupObject("DeclarativeGroupExample")
      .addChild(new ShapeObject()
        .setMetadata(new MetadataStringObject("FindableMetadataStringTest").setName("findThisNameValue").setValue(new MFStringObject("\"test case\"")))
        .setAppearance(new AppearanceObject("DeclarativeAppearanceExample")
          .addComments(" DeclarativeMaterialExample gets overridden by subsequently added MaterialModulator ProtoInstance ")
          .setMaterial(new ProtoInstanceObject("MyMaterialModulator", "MaterialModulator").setDEF("MyMaterialModulator").setName("MaterialModulator")))
        .setGeometry(new ConeObject().setBottom(false).setBottomRadius(0.05f).setHeight(0.1f)))
      .addComments(" Test success: declarativeGroup.addChild() singleton pipeline method "))
    .addComments(" Test success: declarative statement addChild() ")
    .addComments(" Test success: x3dModel.findNodeByDEF(DeclarativeAppearanceExample) = <Appearance DEF='DeclarativeAppearanceExample'/> i.e. <Appearance DEF='DeclarativeAppearanceExample'> <!- - DeclarativeMaterialExample gets overridden by subsequently added MaterialModulator ProtoInstance - -> <ProtoInstance DEF='MyMaterialModulator' name='MaterialModulator' containerField='material'/> </Appearance> ")
    .addComments(" Test success: x3dModel.findElementByNameValue(findThisNameValue) = <MetadataString DEF='FindableMetadataStringTest' name='findThisNameValue' value='\"test case\"'/> ")
    .addComments(" Test success: x3dModel.findElementByNameValue(\"ArtDeco01Material\", \"ProtoDeclare\") found ")
    .addComments(" Test success: x3dModel.findElementByNameValue(\"MaterialModulator\", \"ProtoDeclare\") found ")
    .addComments(" Test success: x3dModel.findElementByNameValue(\"MaterialModulator\", \"ProtoInstance\") found ")
    .addChild(new GroupObject("TestFieldObjectsGroup")
      .addComments(" testFieldObjects() results ")
      .addComments(" SFBool default=true, true=true, false=false, negate()=true ")
      .addComments(" MFBool default=, initial=true false true, negate()=false true false ")
      .addComments(" SFFloat default=0.0, initial=1.0, setValue(2)=2.0, setValue(3.0f)=3.0, setValue(4.0)=4.0 ")
      .addComments(" MFFloat default=, initial=1 2 3, append(5)=1 2 3 5, inserts(3,4)(0,0)=0 1 2 3 4 5, append(6)=0 1 2 3 4 5 6, size()=7 ")
      .addComments(" ... get1Value[3]=3.0, remove[1]=0 2 3 4 5 6, set1Value(0,10)=10 2 3 4 5 6, multiply(2)=20 4 6 8 10 12, clear= ")
      .addComments(" SFVec3f default=0 0 0, initial=1 2 3, setValue=4 5 6, multiply(2)=8 10 12, normalize()=0.45584232 0.5698029 0.68376344, regex matches()=true ")
      .addComments(" regex test SFVec3f().matches(\"1 2 3\")=true, regex test SFVec3f().matches(\"1 2 3 4\")=false, regex test (SFRotationObject.matches(\"0 0 0 0\")=true, failure detecting illegal (zero axis) rotation value "))
    .addChild(new SoundObject().setLocation(0.0f,1.6f,0.0f)
      .addComments(" set sound-ellipsoid location height at 1.6m to match typical avatar height ")
      .setSource(new AudioClipObject().setDescription("chimes").setUrl(new MFStringObject("\"chimes.wav\" \"http://www.web3d.org/x3d/content/examples/ConformanceNist/Sounds/AudioClip/chimes.wav\""))
        .addComments(" Scene example fragment from http://www.web3d.org/x3d/content/examples/ConformanceNist/Sounds/AudioClip/default.x3d ")))
    .addChild(new SoundObject().setLocation(0.0f,1.6f,0.0f)
      .addComments(" set sound-ellipsoid location height at 1.6m to match typical avatar height ")
      .setSource(new MovieTextureObject().setDescription("mpgsys.mpg from ConformanceNist suite").setUrl(new MFStringObject("\"mpgsys.mpg\" \"http://www.web3d.org/x3d/content/examples/ConformanceNist/Appearance/MovieTexture/mpgsys.mpg\""))
        .addComments(" Scene example fragment from http://www.web3d.org/x3d/content/examples/ConformanceNist/Appearance/MovieTexture/mpeg1-systems.x3d ")
        .addComments(" Expected containerField='source', allowed containerField values=\"texture\" \"source\" \"back\" \"bottom\" \"front\" \"left\" \"right\" \"top\" \"backTexture\" \"bottomTexture\" \"frontTexture\" \"leftTexture\" \"rightTexture\" \"topTexture\" \"watchList\" ")))
    .addComments(" Test success: AnchorObject.isNode()=true, siteAnchor.isNode()=true ")
    .addComments(" Test success: AnchorObject.isStatement()=false, siteAnchor.isStatement()=false ")
    .addComments(" Test success: ROUTEObject.isNode()=false, orbitPositionROUTE.isNode()=false ")
    .addComments(" Test success: ROUTEObject.isStatement()=true, orbitPositionROUTE.isStatement()=true ")
    .addComments(" Test success: CommentsBlock.isNode()=false, testComments.isNode()=false ")
    .addComments(" Test failure: CommentsBlock.isStatement()=true, testComments.isStatement()=true ")
    .addChild(new ShapeObject("ExtrusionShape")
      .addComments(" ExampleExtrusion isCrossSectionClosed()=true, crossSection='[1.0, 1.0, 1.0, -1.0, -1.0, -1.0, -1.0, 1.0, 1.0, 1.0]' ")
      .addComments(" ExampleExtrusion isSpineClosed()=false, spine='[0.0, 0.0, 0.0, 0.0, 1.0, 0.0]' ")
      .setAppearance(new AppearanceObject("TransparentAppearance")
        .setMaterial(new MaterialObject().setTransparency(1.0f)))
      .setGeometry(new ExtrusionObject("ExampleExtrusion"))));
    }
	// end of initialize() method

	/** The initialized model object, created within initialize() method. */
	private X3DObject x3dModel;

	/** Provide a 
	 * <a href="https://dzone.com/articles/java-copy-shallow-vs-deep-in-which-you-will-swim" target="_blank">shallow copy</a>
	 * of the X3D model.
	 * @see <a href="http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Core/X3DObject.html">X3DObject</a>
	 * @return temporaryJavaOutputFile model
	 */
	public X3DObject getX3dModel()
	{	  
		return x3dModel;
	}
	   
    /** Default main() method provided for test purposes, uses CommandLine to set global ConfigurationProperties for this object.
     * @param args array of input parameters, provided as arguments
	 * @see <a href="http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Core/X3DObject.html#handleArguments-java.lang.String:A-">X3DObject.handleArguments(args)</a>
	 * @see <a href="http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Core/X3DObject.html#validationReport--">X3DObject.validationReport()</a>
     * @see <a href="http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/CommandLine.html">CommandLine</a>
     * @see <a href="http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/CommandLine.html#USAGE">CommandLine.USAGE</a>
     * @see <a href="http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/ConfigurationProperties.html">ConfigurationProperties</a>
     */
    public static void main(String args[])
    {
        X3DObject thisExampleX3dObject = new temporaryJavaOutputFile().getX3dModel();

		boolean hasArguments = (args != null) && (args.length > 0);
		boolean validate = true; // default
		boolean argumentsLoadNewModel = false;
		String  fileName = new String();

		if (args != null)
		{
			for (String arg : args)
			{
				if (arg.toLowerCase().startsWith("-v") || arg.toLowerCase().contains("validate"))
				{
					validate = true; // making sure
				}
				if (arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_X3D) ||
					arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_CLASSICVRML) ||
					arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_X3DB) ||
					arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_VRML97) ||
					arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_EXI) ||
					arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_GZIP) ||
					arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_ZIP) ||
					arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_HTML) ||
					arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_XHTML))
				{
					argumentsLoadNewModel = true;
					fileName = arg;
				}
			}
		}
		if      (argumentsLoadNewModel)
			System.out.println("WARNING: \"temporaryJavaOutputFile\" model invocation is attempting to load file \"" + fileName + "\" instead of simply validating itself... file loading ignored.");
		else if (hasArguments) // if no arguments provided, this method produces usage warning
			thisExampleX3dObject.handleArguments(args);

		if (validate)
		{
			System.out.print("Java program \"temporaryJavaOutputFile\" self-validation test results: ");
			String validationResults = thisExampleX3dObject.validationReport();
			System.out.println(validationResults);
		}
    }
}

===========================================
Create JSON Encoding of model using stylesheet X3dToJson.xslt
Warning: toFileStylesheetConversion(X3dToJson.xslt) is overwriting prior file HelloWorldProgramOutput.json
Script DEF=colorTypeConversionScript contains CDATA source-code text, copied as "#sourceText" using "strings" mode
Script DEF=MaterialModulatorScript contains CDATA source-code text, copied as "#sourceText" using "strings" mode
helloWorldObject.toFileJSON("HelloWorldProgramOutput.json") success: true
C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples\HelloWorldProgramOutput.json
Test toStringJSON()

Script DEF=colorTypeConversionScript contains CDATA source-code text, copied as "#sourceText" using "strings" mode
Script DEF=MaterialModulatorScript contains CDATA source-code text, copied as "#sourceText" using "strings" mode
{ "X3D": {
    "encoding":"UTF-8",
    "@profile":"Immersive",
    "@version":"3.3",
    "@xsd:noNamespaceSchemaLocation":"http://www.web3d.org/specifications/x3d-3.3.xsd",
    "JSON schema":"http://www.web3d.org/specifications/x3d-3.3-JSONSchema.json",
    "head": {
        "-children":[
          {
            "#comment":"comment #1"
          },
          {
            "#comment":"comment #2"
          },
          {
            "#comment":"comment #3"
          },
          {
            "#comment":"comment #4"
          }
        ],
        "component": [
          {
            "@name":"Navigation",
            "@level":3
          },
          {
            "@name":"Layering",
            "@level":1
          }
        ],
        "unit": [
          {
            "@name":"AngleUnitConversion",
            "@category":"angle",
            "@conversionFactor":1.0
          },
          {
            "@name":"LengthUnitConversion",
            "@category":"length",
            "@conversionFactor":1.0
          }
        ],
        "meta": [
          {
            "@name":"title",
            "@content":"HelloWorldProgramOutput.x3d"
          },
          {
            "@name":"description",
            "@content":"Example HelloWorldProgram creates an X3D model using the X3D Java Scene Access Interface Library (X3DJSAIL)"
          },
          {
            "@name":"reference",
            "@content":"http://www.web3d.org/specifications/java/X3DJSAIL.html"
          },
          {
            "@name":"generator",
            "@content":"HelloWorldProgramOutput.java"
          },
          {
            "@name":"created",
            "@content":"6 September 2016"
          },
          {
            "@name":"modified",
            "@content":"14 October 2018"
          },
          {
            "@name":"generator",
            "@content":"X3D Java Scene Access Interface Library (X3DJSAIL)"
          },
          {
            "@name":"generator",
            "@content":"http://www.web3d.org/specifications/java/examples/HelloWorldProgram.java"
          },
          {
            "@name":"generator",
            "@content":"Netbeans http://www.netbeans.org"
          },
          {
            "@name":"creator",
            "@content":"Don Brutzman"
          },
          {
            "@name":"reference",
            "@content":"https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/java/examples/HelloWorldProgramOutput.x3d"
          },
          {
            "@name":"reference",
            "@content":"Console output, ClassicVRML encoding, VRML97 encoding and pretty-print documentation:"
          },
          {
            "@name":"reference",
            "@content":"HelloWorldProgramOutput.txt"
          },
          {
            "@name":"reference",
            "@content":"HelloWorldProgramOutput.x3dv"
          },
          {
            "@name":"reference",
            "@content":"HelloWorldProgramOutput.wrl"
          },
          {
            "@name":"reference",
            "@content":"HelloWorldProgramOutput.html"
          },
          {
            "@name":"X3dValidator",
            "@content":"https://savage.nps.edu/X3dValidator?url=http://www.web3d.org/specifications/java/examples/HelloWorldProgramOutput.x3d"
          },
          {
            "@name":"identifier",
            "@content":"http://www.web3d.org/specifications/java/examples/HelloWorldProgramOutput.x3d"
          },
          {
            "@name":"license",
            "@content":"../license.html"
          },
          {
            "@name":"SpecialTest",
            "@content":"tested sat: name value cannot contain embedded space character"
          },
          {
            "@name":"translated",
            "@content":"14 October 2018"
          },
          {
            "@name":"generator",
            "@content":"X3dToJson.xslt, http://www.web3d.org/x3d/stylesheets/X3dToJson.html"
          },
          {
            "@name":"reference",
            "@content":"X3D JSON encoding: http://www.web3d.org/wiki/index.php/X3D_JSON_Encoding"
          }
        ]
    },
    "Scene": {
        "-children":[
          { "ViewpointGroup":
            {
              "@description":"Available viewpoints",
              "-children":[
                { "Viewpoint":
                  {
                    "@DEF":"DefaultView",
                    "@description":"Hello X3DJSAIL"
                  }
                },
                { "Viewpoint":
                  {
                    "@DEF":"TopDownView",
                    "@description":"top-down view from above",
                    "@orientation":[1,0,0,-1.570796],
                    "@position":[0,100,0]
                  }
                }
              ]
            }
          },
          { "WorldInfo":
            {
              "@DEF":"WorldInfoDEF",
              "@title":"HelloWorldProgram produced by X3D Java SAI Library (X3DJSAIL)"
            }
          },
          { "WorldInfo":
            {
              "@USE":"WorldInfoDEF"
            }
          },
          { "WorldInfo":
            {
              "@USE":"WorldInfoDEF"
            }
          },
          { "MetadataString":
            {
              "@name":"test",
              "@DEF":"scene.addChildMetadata",
              "@value":["Top-level root Metadata node beneath Scene needs to be one of '-children' in JSON encoding"]
            }
          },
          { "LayerSet":
            {
              "@DEF":"scene.addChildLayerSetTest"
            }
          },
          { "Transform":
            {
              "@DEF":"LogoGeometryTransform",
              "@translation":[0,1.5,0],
              "-children":[
                { "Anchor":
                  {
                    "@description":"select for X3D Java SAI Library (X3DJSAIL) description",
                    "@url":["../X3DJSAIL.html","http://www.web3d.org/specifications/java/X3DJSAIL.html"],
                    "-children":[
                      { "Shape":
                        {
                          "@DEF":"BoxShape",
                          "-appearance":
                            { "Appearance":
                              {
                                "-material":
                                  { "Material":
                                    {
                                      "@DEF":"GreenMaterial",
                                      "@diffuseColor":[0,1,1],
                                      "@emissiveColor":[0.8,0,0],
                                      "@transparency":0.1
                                    }
                                  },
                                "-texture":
                                  { "ImageTexture":
                                    {
                                      "@url":["images/X3dJavaSceneAccessInterfaceSaiLibrary.png","http://www.web3d.org/specifications/java/examples/images/X3dJavaSceneAccessInterfaceSaiLibrary.png"]
                                    }
                                  }
                              }
                            },
                          "-geometry":
                            { "Box":
                              {
                                "@DEF":"test-NMTOKEN_regex.0123456789",
                                "@class":"untextured"
                              }
                            }
                        }
                      }
                    ]
                  }
                }
              ]
            }
          },
          { "Shape":
            {
              "@DEF":"LineShape",
              "-appearance":
                { "Appearance":
                  {
                    "-material":
                      { "Material":
                        {
                          "@emissiveColor":[0.6,0.19607843,0.8]
                        }
                      }
                  }
                },
              "-geometry":
                { "IndexedLineSet":
                  {
                    "@coordIndex":[0,1,2,3,4,0],
                    "-children":[
                      {
                        "#comment":"Coordinate 3-tuple point count: 6"
                      }
                    ],
                    "-coord":
                      { "Coordinate":
                        {
                          "@point":[0,1.5,0,2,1.5,0,2,1.5,-2,-2,1.5,-2,-2,1.5,0,0,1.5,0]
                        }
                      }
                  }
                }
            }
          },
          { "PositionInterpolator":
            {
              "@DEF":"BoxPathAnimator",
              "@key":[0,0.125,0.375,0.625,0.875,1],
              "@keyValue":[0,1.5,0,2,1.5,0,2,1.5,-2,-2,1.5,-2,-2,1.5,0,0,1.5,0]
            }
          },
          { "TimeSensor":
            {
              "@DEF":"OrbitClock",
              "@cycleInterval":8.0,
              "@loop":true
            }
          },
          { "ROUTE":
            {
              "@fromField":"fraction_changed",
              "@fromNode":"OrbitClock",
              "@toField":"set_fraction",
              "@toNode":"BoxPathAnimator"
            }
          },
          { "ROUTE":
            {
              "@fromField":"value_changed",
              "@fromNode":"BoxPathAnimator",
              "@toField":"set_translation",
              "@toNode":"LogoGeometryTransform"
            }
          },
          { "Transform":
            {
              "@DEF":"TextTransform",
              "@translation":[0,-1.5,0],
              "-children":[
                { "Shape":
                  {
                    "-appearance":
                      { "Appearance":
                        {
                          "-material":
                            { "Material":
                              {
                                "@USE":"GreenMaterial"
                              }
                            }
                        }
                      },
                    "-geometry":
                      { "Text":
                        {
                          "@string":["X3D Java","SAI Library","X3DJSAIL"],
                          "-children":[
                            {
                              "#comment":"Comment example A, plain quotation marks: He said, \"Immel did it!\""
                            },
                            {
                              "#comment":"Comment example B, XML character entities: He said, &quot;Immel did it!&quot;"
                            }
                          ],
                          "-metadata":
                            { "MetadataSet":
                              {
                                "@name":"EscapedQuotationMarksMetadataSet",
                                "-value":[
                                  { "MetadataString":
                                    {
                                      "@name":"quotesTestC",
                                      "@value":["MFString example C, backslash-escaped quotes: He said, \"Immel did it!\""]
                                    }
                                  },
                                  { "MetadataString":
                                    {
                                      "@name":"extraChildTest",
                                      "@value":["checks MetadataSetObject addValue() method"]
                                    }
                                  }
                                ]
                              }
                            },
                          "-fontStyle":
                            { "FontStyle":
                              {
                              }
                            }
                        }
                      }
                  }
                },
                { "Collision":
                  {
                    "-children":[
                      {
                        "#comment":"test containerField='proxy'"
                      }
                    ],
                    "-proxy":
                      { "Shape":
                        {
                          "@DEF":"ProxyShape",
                          "-children":[
                            {
                              "#comment":"alternative XML encoding: Text string='\"One, Two, Comment\" \"\" \"He said, \\&quot;Immel did it!\\&quot;\"'"
                            },
                            {
                              "#comment":"alternative XML encoding: Text string='\"One, Two, Comment\" \"\" \"He said, \\&quot;Immel did it!\\&quot;\" \"\"'"
                            },
                            {
                              "#comment":"alternative Java source: .setString(new String [] {\"One, Two, Comment\", \"\", \"He said, \\\"\"Immel did it!\\\"\"\"})"
                            },
                            {
                              "#comment":"reference: http://www.web3d.org/x3d/content/examples/Basic/X3dSpecifications/StringArrayEncodingExamplesIndex.html"
                            }
                          ],
                          "-geometry":
                            { "Text":
                              {
                                "@string":["One, Two, Text","","He said, \"Immel did it!\" \"\""]
                              }
                            }
                        }
                      }
                  }
                },
                {
                  "#comment":"It's a beautiful world"
                },
                {
                  "#comment":"... for you!"
                },
                {
                  "#comment":"https://en.wikipedia.org/wiki/Beautiful_World_(Devo_song)"
                }
              ]
            }
          },
          {
            "#comment":"repeatedly spin 180 degrees as a readable special effect"
          },
          { "OrientationInterpolator":
            {
              "@DEF":"SpinInterpolator",
              "@keyValue":[0,1,0,4.712389,0,1,0,0,0,1,0,1.5707964]
            }
          },
          { "TimeSensor":
            {
              "@DEF":"SpinClock",
              "@cycleInterval":5.0,
              "@loop":true
            }
          },
          { "ROUTE":
            {
              "@fromField":"fraction_changed",
              "@fromNode":"SpinClock",
              "@toField":"set_fraction",
              "@toNode":"SpinInterpolator"
            }
          },
          { "ROUTE":
            {
              "@fromField":"value_changed",
              "@fromNode":"SpinInterpolator",
              "@toField":"rotation",
              "@toNode":"TextTransform"
            }
          },
          { "Group":
            {
              "@DEF":"BackgroundGroup",
              "-children":[
                { "Background":
                  {
                    "@DEF":"GradualBackground"
                  }
                },
                { "Script":
                  {
                    "@DEF":"colorTypeConversionScript",
                    "field": [
                      {
                        "@name":"colorInput",
                        "@accessType":"inputOnly",
                        "@type":"SFColor"
                      },
                      {
                        "@name":"colorsOutput",
                        "@accessType":"outputOnly",
                        "@type":"MFColor"
                      }
                    ],
                    "#sourceText":[
"",
"",
"ecmascript:",
"",
"function colorInput (eventValue) // Example source code",
"{",
"   colorsOutput = new MFColor(eventValue); // assigning value sends output event",
"// Browser.print('colorInput=' + eventValue + ', colorsOutput=' + colorsOutput + '\n');",
"}",
"",
""
]
                  }
                },
                { "ColorInterpolator":
                  {
                    "@DEF":"ColorAnimator",
                    "@keyValue":[0.9411765,1,1,0.29411766,0,0.50980395,0.9411765,1,1],
                    "-children":[
                      {
                        "#comment":"AZURE to INDIGO and back again"
                      }
                    ]
                  }
                },
                { "TimeSensor":
                  {
                    "@DEF":"ColorClock",
                    "@cycleInterval":60.0,
                    "@loop":true
                  }
                },
                { "ROUTE":
                  {
                    "@fromField":"colorsOutput",
                    "@fromNode":"colorTypeConversionScript",
                    "@toField":"skyColor",
                    "@toNode":"GradualBackground"
                  }
                },
                { "ROUTE":
                  {
                    "@fromField":"value_changed",
                    "@fromNode":"ColorAnimator",
                    "@toField":"colorInput",
                    "@toNode":"colorTypeConversionScript"
                  }
                },
                { "ROUTE":
                  {
                    "@fromField":"fraction_changed",
                    "@fromNode":"ColorClock",
                    "@toField":"set_fraction",
                    "@toNode":"ColorAnimator"
                  }
                }
              ]
            }
          },
          { "ProtoDeclare":
            {
              "@name":"ArtDeco01Material",
              "@appinfo":"tooltip: ArtDeco01Material prototype is a Material node",
              "ProtoInterface": {
                  "field": [
                    {
                      "@name":"description",
                      "@accessType":"inputOutput",
                      "@appinfo":"tooltip for descriptionField",
                      "@type":"SFString",
                      "@value":"ArtDeco01Material prototype is a Material node"
                    },
                    {
                      "@name":"enabled",
                      "@accessType":"inputOutput",
                      "@type":"SFBool",
                      "@value":true
                    }
                  ]
              },
              "ProtoBody": {
                  "-children":[
                    {
                      "#comment":"Initial node of ProtoBody determines prototype node type"
                    },
                    { "Material":
                      {
                        "@ambientIntensity":0.25,
                        "@diffuseColor":[0.282435,0.085159,0.134462],
                        "@shininess":0.127273,
                        "@specularColor":[0.276305,0.11431,0.139857]
                      }
                    },
                    {
                      "#comment":"[HelloWorldProgram diagnostic] should be connected to scene graph: artDeco01ProtoDeclare.getNodeType()=\"Material\""
                    },
                    {
                      "#comment":"presence of follow-on TouchSensor shows that additional nodes are allowed in ProtoBody after initial node, regardless of node types"
                    },
                    { "TouchSensor":
                      {
                        "@description":"within ProtoBody",
                        "IS": {
                            "connect": [
                              {
                                "@nodeField":"description",
                                "@protoField":"description"
                              },
                              {
                                "@nodeField":"enabled",
                                "@protoField":"enabled"
                              }
                            ]
                        }
                      }
                    }
                  ]
              }
            }
          },
          { "ExternProtoDeclare":
            {
              "@name":"ArtDeco02Material",
              "@appinfo":"this is a different Material node",
              "@url":["http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter14Prototypes/ArtDecoPrototypesExcerpt.x3d#ArtDeco02Material","http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter14Prototypes/ArtDecoPrototypesExcerpt.x3dv#ArtDeco02Material"],
              "-children":[
                {
                  "#comment":"[HelloWorldProgram diagnostic] artDeco02ExternProtoDeclare.getNodeType()=\"ERROR_UNKNOWN_EXTERNPROTODECLARE_NODE_TYPE: ExternProtoDeclare name='ArtDeco02Material' type cannot be remotely accessed at run time. TODO X3DJSAIL needs to add further capability that retrieves the ExternProtoDeclare file.\""
                }
              ],
              "field": [
                {
                  "@name":"description",
                  "@accessType":"inputOutput",
                  "@appinfo":"tooltip for descriptionField",
                  "@type":"SFString"
                }
              ]
            }
          },
          {
            "#comment":"Tested ArtDeco01ProtoInstance, ArtDeco02ProtoInstance for improper node type when ProtoInstance is added in wrong place"
          },
          { "Shape":
            {
              "@DEF":"TestShape1",
              "-appearance":
                { "Appearance":
                  {
                    "@DEF":"TestAppearance1",
                    "-children":[
                      {
                        "#comment":"ArtDeco01Material prototype goes here... TODO ensure setContainerField is handled in exported Java"
                      }
                    ],
                    "-material":
                      { "ProtoInstance":
                        {
                          "@name":"ArtDeco01Material",
                          "-children":[
                            {
                              "#comment":"[HelloWorldProgram diagnostic] ArtDeco01ProtoInstance.getNodeType()=\"Material\""
                            }
                          ],
                          "fieldValue": [
                            {
                              "@name":"description",
                              "@value":"ArtDeco01Material can substitute for a Material node"
                            }
                          ]
                        }
                      }
                  }
                },
              "-geometry":
                { "Sphere":
                  {
                    "@radius":0.001
                  }
                }
            }
          },
          { "Shape":
            {
              "@DEF":"TestShape2",
              "-appearance":
                { "Appearance":
                  {
                    "@DEF":"TestAppearance2",
                    "-children":[
                      {
                        "#comment":"ArtDeco02Material prototype goes here... TODO ensure setContainerField is handled in exported Java"
                      }
                    ],
                    "-material":
                      { "ProtoInstance":
                        {
                          "@name":"ArtDeco02Material",
                          "@DEF":"ArtDeco02MaterialDEF",
                          "-children":[
                            {
                              "#comment":"[HelloWorldProgram diagnostic] ArtDeco02ProtoInstance.getNodeType()=\"ERROR_UNKNOWN_EXTERNPROTODECLARE_NODE_TYPE: ExternProtoDeclare name='ArtDeco02Material' type cannot be remotely accessed at run time. TODO X3DJSAIL needs to add further capability that retrieves the ExternProtoDeclare file.\""
                            }
                          ],
                          "fieldValue": [
                            {
                              "@name":"description",
                              "@value":"ArtDeco02Material can substitute for another Material node"
                            }
                          ]
                        }
                      }
                  }
                },
              "-geometry":
                { "Cone":
                  {
                    "@bottomRadius":0.001,
                    "@height":0.001
                  }
                }
            }
          },
          { "Shape":
            {
              "@DEF":"TestShape3",
              "-appearance":
                { "Appearance":
                  {
                    "@DEF":"TestAppearance3",
                    "-children":[
                      {
                        "#comment":"ArtDeco02Material ProtoInstance USE goes here..."
                      }
                    ],
                    "-material":
                      { "ProtoInstance":
                        {
                          "@USE":"ArtDeco02MaterialDEF"
                        }
                      }
                  }
                },
              "-geometry":
                { "Cylinder":
                  {
                    "@height":0.001,
                    "@radius":0.001
                  }
                }
            }
          },
          { "Inline":
            {
              "@DEF":"inlineSceneDef",
              "@url":["someOtherScene.x3d"]
            }
          },
          { "IMPORT":
            {
              "@AS":"WorldInfoDEF2",
              "@importedDEF":"WorldInfoDEF",
              "@inlineDEF":"inlineSceneDef"
            }
          },
          { "EXPORT":
            {
              "@AS":"WorldInfoDEF3",
              "@localDEF":"WorldInfoDEF"
            }
          },
          { "ProtoDeclare":
            {
              "@name":"MaterialModulator",
              "@appinfo":"mimic a Material node and modulate fields as an animation effect",
              "@documentation":"http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter14Prototypes/MaterialModulatorIndex.html",
              "ProtoInterface": {
                  "field": [
                    {
                      "@name":"enabled",
                      "@accessType":"inputOutput",
                      "@type":"SFBool",
                      "@value":true
                    },
                    {
                      "@name":"diffuseColor",
                      "@accessType":"inputOutput",
                      "@type":"SFColor",
                      "@value":[0,0,0]
                    },
                    {
                      "@name":"emissiveColor",
                      "@accessType":"inputOutput",
                      "@type":"SFColor",
                      "@value":[0.05,0.05,0.5]
                    },
                    {
                      "@name":"specularColor",
                      "@accessType":"inputOutput",
                      "@type":"SFColor",
                      "@value":[0,0,0]
                    },
                    {
                      "@name":"transparency",
                      "@accessType":"inputOutput",
                      "@type":"SFFloat",
                      "@value":0.0
                    },
                    {
                      "@name":"shininess",
                      "@accessType":"inputOutput",
                      "@type":"SFFloat",
                      "@value":0.0
                    },
                    {
                      "@name":"ambientIntensity",
                      "@accessType":"inputOutput",
                      "@type":"SFFloat",
                      "@value":0.0
                    }
                  ]
              },
              "ProtoBody": {
                  "-children":[
                    { "Material":
                      {
                        "@DEF":"MaterialNode",
                        "IS": {
                            "connect": [
                              {
                                "@nodeField":"diffuseColor",
                                "@protoField":"diffuseColor"
                              },
                              {
                                "@nodeField":"emissiveColor",
                                "@protoField":"emissiveColor"
                              },
                              {
                                "@nodeField":"specularColor",
                                "@protoField":"specularColor"
                              },
                              {
                                "@nodeField":"transparency",
                                "@protoField":"transparency"
                              },
                              {
                                "@nodeField":"shininess",
                                "@protoField":"shininess"
                              },
                              {
                                "@nodeField":"ambientIntensity",
                                "@protoField":"ambientIntensity"
                              }
                            ]
                        }
                      }
                    },
                    {
                      "#comment":"Only first node (the node type) is renderable, others are along for the ride"
                    },
                    { "Script":
                      {
                        "@DEF":"MaterialModulatorScript",
                        "field": [
                          {
                            "@name":"enabled",
                            "@accessType":"inputOutput",
                            "@type":"SFBool"
                          },
                          {
                            "@name":"diffuseColor",
                            "@accessType":"inputOutput",
                            "@type":"SFColor"
                          },
                          {
                            "@name":"newColor",
                            "@accessType":"outputOnly",
                            "@type":"SFColor"
                          },
                          {
                            "@name":"clockTrigger",
                            "@accessType":"inputOnly",
                            "@type":"SFTime"
                          }
                        ],
                        "IS": {
                            "connect": [
                              {
                                "@nodeField":"enabled",
                                "@protoField":"enabled"
                              },
                              {
                                "@nodeField":"diffuseColor",
                                "@protoField":"diffuseColor"
                              }
                            ]
                        },
                        "#sourceText":[
"",
"",
"ecmascript:",
"function initialize ()",
"{",
"    newColor = diffuseColor; // start with correct color",
"}",
"function set_enabled (newValue)",
"{",
"\tenabled = newValue;",
"}",
"function clockTrigger (timeValue)",
"{",
"    if (!enabled) return;",
"    red   = newColor.r;",
"    green = newColor.g;",
"    blue  = newColor.b;",
"",
"    // note different modulation rates for each color component, % is modulus operator",
"    newColor = new SFColor ((red + 0.02) % 1, (green + 0.03) % 1, (blue + 0.04) % 1);",
"\tif (enabled)",
"\t{",
"\t\tBrowser.print ('diffuseColor=(' + red + ',' + green + ',' + blue + ') newColor=' + newColor.toString() + '\n');",
"\t}",
"}",
"",
""
]
                      }
                    }
                  ]
              }
            }
          },
          {
            "#comment":"Test success: declarative statement createDeclarativeShapeTests()"
          },
          { "Group":
            {
              "@DEF":"DeclarativeGroupExample",
              "-children":[
                { "Shape":
                  {
                    "-metadata":
                      { "MetadataString":
                        {
                          "@name":"findThisNameValue",
                          "@DEF":"FindableMetadataStringTest",
                          "@value":["test case"]
                        }
                      },
                    "-appearance":
                      { "Appearance":
                        {
                          "@DEF":"DeclarativeAppearanceExample",
                          "-children":[
                            {
                              "#comment":"DeclarativeMaterialExample gets overridden by subsequently added MaterialModulator ProtoInstance"
                            }
                          ],
                          "-material":
                            { "ProtoInstance":
                              {
                                "@name":"MaterialModulator",
                                "@DEF":"MyMaterialModulator"
                              }
                            }
                        }
                      },
                    "-geometry":
                      { "Cone":
                        {
                          "@bottom":false,
                          "@bottomRadius":0.05,
                          "@height":0.1
                        }
                      }
                  }
                },
                {
                  "#comment":"Test success: declarativeGroup.addChild() singleton pipeline method"
                }
              ]
            }
          },
          {
            "#comment":"Test success: declarative statement addChild()"
          },
          {
            "#comment":"Test success: x3dModel.findNodeByDEF(DeclarativeAppearanceExample) = <Appearance DEF='DeclarativeAppearanceExample'/> i.e. <Appearance DEF='DeclarativeAppearanceExample'> <!- - DeclarativeMaterialExample gets overridden by subsequently added MaterialModulator ProtoInstance - -> <ProtoInstance DEF='MyMaterialModulator' name='MaterialModulator' containerField='material'/> </Appearance>"
          },
          {
            "#comment":"Test success: x3dModel.findElementByNameValue(findThisNameValue) = <MetadataString DEF='FindableMetadataStringTest' name='findThisNameValue' value='\"test case\"'/>"
          },
          {
            "#comment":"Test success: x3dModel.findElementByNameValue(\"ArtDeco01Material\", \"ProtoDeclare\") found"
          },
          {
            "#comment":"Test success: x3dModel.findElementByNameValue(\"MaterialModulator\", \"ProtoDeclare\") found"
          },
          {
            "#comment":"Test success: x3dModel.findElementByNameValue(\"MaterialModulator\", \"ProtoInstance\") found"
          },
          { "Group":
            {
              "@DEF":"TestFieldObjectsGroup",
              "-children":[
                {
                  "#comment":"testFieldObjects() results"
                },
                {
                  "#comment":"SFBool default=true, true=true, false=false, negate()=true"
                },
                {
                  "#comment":"MFBool default=, initial=true false true, negate()=false true false"
                },
                {
                  "#comment":"SFFloat default=0.0, initial=1.0, setValue(2)=2.0, setValue(3.0f)=3.0, setValue(4.0)=4.0"
                },
                {
                  "#comment":"MFFloat default=, initial=1 2 3, append(5)=1 2 3 5, inserts(3,4)(0,0)=0 1 2 3 4 5, append(6)=0 1 2 3 4 5 6, size()=7"
                },
                {
                  "#comment":"... get1Value[3]=3.0, remove[1]=0 2 3 4 5 6, set1Value(0,10)=10 2 3 4 5 6, multiply(2)=20 4 6 8 10 12, clear="
                },
                {
                  "#comment":"SFVec3f default=0 0 0, initial=1 2 3, setValue=4 5 6, multiply(2)=8 10 12, normalize()=0.45584232 0.5698029 0.68376344, regex matches()=true"
                },
                {
                  "#comment":"regex test SFVec3f().matches(\"1 2 3\")=true, regex test SFVec3f().matches(\"1 2 3 4\")=false, regex test (SFRotationObject.matches(\"0 0 0 0\")=true, failure detecting illegal (zero axis) rotation value"
                }
              ]
            }
          },
          { "Sound":
            {
              "@location":[0,1.6,0],
              "-children":[
                {
                  "#comment":"set sound-ellipsoid location height at 1.6m to match typical avatar height"
                }
              ],
              "-source":
                { "AudioClip":
                  {
                    "@description":"chimes",
                    "@url":["chimes.wav","http://www.web3d.org/x3d/content/examples/ConformanceNist/Sounds/AudioClip/chimes.wav"],
                    "-children":[
                      {
                        "#comment":"Scene example fragment from http://www.web3d.org/x3d/content/examples/ConformanceNist/Sounds/AudioClip/default.x3d"
                      }
                    ]
                  }
                }
            }
          },
          { "Sound":
            {
              "@location":[0,1.6,0],
              "-children":[
                {
                  "#comment":"set sound-ellipsoid location height at 1.6m to match typical avatar height"
                }
              ],
              "-source":
                { "MovieTexture":
                  {
                    "@description":"mpgsys.mpg from ConformanceNist suite",
                    "@url":["mpgsys.mpg","http://www.web3d.org/x3d/content/examples/ConformanceNist/Appearance/MovieTexture/mpgsys.mpg"],
                    "-children":[
                      {
                        "#comment":"Scene example fragment from http://www.web3d.org/x3d/content/examples/ConformanceNist/Appearance/MovieTexture/mpeg1-systems.x3d"
                      },
                      {
                        "#comment":"Expected containerField='source', allowed containerField values=\"texture\" \"source\" \"back\" \"bottom\" \"front\" \"left\" \"right\" \"top\" \"backTexture\" \"bottomTexture\" \"frontTexture\" \"leftTexture\" \"rightTexture\" \"topTexture\" \"watchList\""
                      }
                    ]
                  }
                }
            }
          },
          {
            "#comment":"Test success: AnchorObject.isNode()=true, siteAnchor.isNode()=true"
          },
          {
            "#comment":"Test success: AnchorObject.isStatement()=false, siteAnchor.isStatement()=false"
          },
          {
            "#comment":"Test success: ROUTEObject.isNode()=false, orbitPositionROUTE.isNode()=false"
          },
          {
            "#comment":"Test success: ROUTEObject.isStatement()=true, orbitPositionROUTE.isStatement()=true"
          },
          {
            "#comment":"Test success: CommentsBlock.isNode()=false, testComments.isNode()=false"
          },
          {
            "#comment":"Test failure: CommentsBlock.isStatement()=true, testComments.isStatement()=true"
          },
          { "Shape":
            {
              "@DEF":"ExtrusionShape",
              "-children":[
                {
                  "#comment":"ExampleExtrusion isCrossSectionClosed()=true, crossSection='[1.0, 1.0, 1.0, -1.0, -1.0, -1.0, -1.0, 1.0, 1.0, 1.0]'"
                },
                {
                  "#comment":"ExampleExtrusion isSpineClosed()=false, spine='[0.0, 0.0, 0.0, 0.0, 1.0, 0.0]'"
                }
              ],
              "-appearance":
                { "Appearance":
                  {
                    "@DEF":"TransparentAppearance",
                    "-material":
                      { "Material":
                        {
                          "@transparency":1.0
                        }
                      }
                  }
                },
              "-geometry":
                { "Extrusion":
                  {
                    "@DEF":"ExampleExtrusion"
                  }
                }
            }
          }
        ]
    }
  }
}

===========================================
Create displayable scene page rendered with X3DOM using stylesheet X3dToX3dom.xslt
Warning: toFileStylesheetConversion(X3dToX3dom.xslt) is overwriting prior file HelloWorldProgramOutputX3dom.xhtml
helloWorldObject.toFileX3DOM("HelloWorldProgramOutputX3dom.xhtml") success: true
C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples\HelloWorldProgramOutputX3dom.xhtml
===========================================
Create displayable scene page rendered with X_ITE (formerly Cobweb) using stylesheet X3dToX3dom.xslt
Warning: toFileStylesheetConversion(X3dToX3dom.xslt) is overwriting prior file HelloWorldProgramOutputX_ITE.html
helloWorldObject.toFileX3DOM("HelloWorldProgramOutputX_ITE.html") success: true
C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples\HelloWorldProgramOutputX_ITE.html
===========================================
Reload and provide text output using Java DOM, which includes default attribute values
===========================================
Test success: x3dLoader.loadX3DfromXML(HelloWorldProgramOutput.x3d), x3dLoader.getX3dObjectTree()
===========================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "http://www.web3d.org/specifications/x3d-3.3.dtd">
<X3D profile='Immersive' version='3.3' xmlns:ds='http://www.w3.org/2000/09/xmldsig#' xmlns:xenc='http://www.w3.org/2001/04/xmlenc#' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-3.3.xsd'>
  <head>
    <!-- comment #1 -->
    <!-- comment #2 -->
    <!-- comment #3 -->
    <!-- comment #4 -->
    <component level='3' name='Navigation'/>
    <component level='1' name='Layering'/>
    <unit category='angle' conversionFactor='1.0' name='AngleUnitConversion'/>
    <unit category='length' conversionFactor='1.0' name='LengthUnitConversion'/>
    <meta content='HelloWorldProgramOutput.x3d' name='title'/>
    <meta content='Example HelloWorldProgram creates an X3D model using the X3D Java Scene Access Interface Library (X3DJSAIL)' name='description'/>
    <meta content='http://www.web3d.org/specifications/java/X3DJSAIL.html' name='reference'/>
    <meta content='HelloWorldProgramOutput.java' name='generator'/>
    <meta content='6 September 2016' name='created'/>
    <meta content='14 October 2018' name='modified'/>
    <meta content='X3D Java Scene Access Interface Library (X3DJSAIL)' name='generator'/>
    <meta content='http://www.web3d.org/specifications/java/examples/HelloWorldProgram.java' name='generator'/>
    <meta content='Netbeans http://www.netbeans.org' name='generator'/>
    <meta content='Don Brutzman' name='creator'/>
    <meta content='https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/java/examples/HelloWorldProgramOutput.x3d' name='reference'/>
    <meta content='Console output, ClassicVRML encoding, VRML97 encoding and pretty-print documentation:' name='reference'/>
    <meta content='HelloWorldProgramOutput.txt' name='reference'/>
    <meta content='HelloWorldProgramOutput.x3dv' name='reference'/>
    <meta content='HelloWorldProgramOutput.wrl' name='reference'/>
    <meta content='HelloWorldProgramOutput.html' name='reference'/>
    <meta content='https://savage.nps.edu/X3dValidator?url=http://www.web3d.org/specifications/java/examples/HelloWorldProgramOutput.x3d' name='X3dValidator'/>
    <meta content='http://www.web3d.org/specifications/java/examples/HelloWorldProgramOutput.x3d' name='identifier'/>
    <meta content='../license.html' name='license'/>
    <meta content='tested sat: name value cannot contain embedded space character' name='SpecialTest'/>
  </head>
  <Scene>
    <ViewpointGroup center='0 0 0' containerField='children' description='Available viewpoints' displayed='true' retainUserOffsets='false' size='0 0 0'>
      <Viewpoint DEF='DefaultView' centerOfRotation='0 0 0' containerField='children' description='Hello X3DJSAIL' fieldOfView='0.7854' jump='true' orientation='0 0 1 0' position='0 0 10' retainUserOffsets='false'/>
      <Viewpoint DEF='TopDownView' centerOfRotation='0 0 0' containerField='children' description='top-down view from above' fieldOfView='0.7854' jump='true' orientation='1 0 0 -1.570796' position='0 100 0' retainUserOffsets='false'/>
    </ViewpointGroup>
    <WorldInfo DEF='WorldInfoDEF' containerField='children' title='HelloWorldProgram produced by X3D Java SAI Library (X3DJSAIL)'/>
    <WorldInfo USE='WorldInfoDEF' containerField='children'/>
    <WorldInfo USE='WorldInfoDEF' containerField='children'/>
    <MetadataString DEF='scene.addChildMetadata' containerField='metadata' name='test' value='"Top-level root Metadata node beneath Scene needs to be one of '-children' in JSON encoding"'/>
    <LayerSet DEF='scene.addChildLayerSetTest' activeLayer='0' containerField='children' order='0'/>
    <Transform DEF='LogoGeometryTransform' bboxCenter='0 0 0' bboxSize='-1 -1 -1' center='0 0 0' containerField='children' rotation='0 0 1 0' scale='1 1 1' scaleOrientation='0 0 1 0' translation='0 1.5 0'>
      <Anchor bboxCenter='0 0 0' bboxSize='-1 -1 -1' containerField='children' description='select for X3D Java SAI Library (X3DJSAIL) description' url='"../X3DJSAIL.html" "http://www.web3d.org/specifications/java/X3DJSAIL.html"'>
        <Shape DEF='BoxShape' bboxCenter='0 0 0' bboxSize='-1 -1 -1' containerField='children'>
          <Appearance containerField='appearance'>
            <Material DEF='GreenMaterial' ambientIntensity='0.2' containerField='material' diffuseColor='0 1 1' emissiveColor='0.8 0 0' shininess='0.2' specularColor='0 0 0' transparency='0.1'/>
            <ImageTexture containerField='texture' repeatS='true' repeatT='true' url='"images/X3dJavaSceneAccessInterfaceSaiLibrary.png" "http://www.web3d.org/specifications/java/examples/images/X3dJavaSceneAccessInterfaceSaiLibrary.png"'/>
          </Appearance>
          <Box DEF='test-NMTOKEN_regex.0123456789' class='untextured' containerField='geometry' size='2 2 2' solid='true'/>
        </Shape>
      </Anchor>
    </Transform>
    <Shape DEF='LineShape' bboxCenter='0 0 0' bboxSize='-1 -1 -1' containerField='children'>
      <Appearance containerField='appearance'>
        <Material ambientIntensity='0.2' containerField='material' diffuseColor='0.8 0.8 0.8' emissiveColor='0.6 0.19607843 0.8' shininess='0.2' specularColor='0 0 0' transparency='0'/>
      </Appearance>
      <IndexedLineSet colorPerVertex='true' containerField='geometry' coordIndex='0 1 2 3 4 0'>
        <!-- Coordinate 3-tuple point count: 6 -->
        <Coordinate containerField='coord' point='0 1.5 0 2 1.5 0 2 1.5 -2 -2 1.5 -2 -2 1.5 0 0 1.5 0'/>
      </IndexedLineSet>
    </Shape>
    <PositionInterpolator DEF='BoxPathAnimator' containerField='children' key='0 0.125 0.375 0.625 0.875 1' keyValue='0 1.5 0 2 1.5 0 2 1.5 -2 -2 1.5 -2 -2 1.5 0 0 1.5 0'/>
    <TimeSensor DEF='OrbitClock' containerField='children' cycleInterval='8.0' enabled='true' loop='true' pauseTime='0' resumeTime='0' startTime='0' stopTime='0'/>
    <ROUTE fromField='fraction_changed' fromNode='OrbitClock' toField='set_fraction' toNode='BoxPathAnimator'/>
    <ROUTE fromField='value_changed' fromNode='BoxPathAnimator' toField='set_translation' toNode='LogoGeometryTransform'/>
    <Transform DEF='TextTransform' bboxCenter='0 0 0' bboxSize='-1 -1 -1' center='0 0 0' containerField='children' rotation='0 0 1 0' scale='1 1 1' scaleOrientation='0 0 1 0' translation='0 -1.5 0'>
      <Shape bboxCenter='0 0 0' bboxSize='-1 -1 -1' containerField='children'>
        <Appearance containerField='appearance'>
          <Material USE='GreenMaterial' ambientIntensity='0.2' containerField='material' diffuseColor='0.8 0.8 0.8' emissiveColor='0 0 0' shininess='0.2' specularColor='0 0 0' transparency='0'/>
        </Appearance>
        <Text containerField='geometry' maxExtent='0.0' solid='false' string='"X3D Java" "SAI Library" "X3DJSAIL"'>
          <!-- Comment example A, plain quotation marks: He said, "Immel did it!" -->
          <!-- Comment example B, XML character entities: He said, &quot;Immel did it!&quot; -->
          <MetadataSet containerField='metadata' name='EscapedQuotationMarksMetadataSet'>
            <MetadataString containerField='value' name='quotesTestC' value='"MFString example C, backslash-escaped quotes: He said, \"Immel did it!\""'/>
            <MetadataString containerField='value' name='extraChildTest' value='"checks MetadataSetObject addValue() method"'/>
          </MetadataSet>
          <FontStyle containerField='fontStyle' family='"SERIF"' horizontal='true' justify='"BEGIN"' leftToRight='true' size='1.0' spacing='1.0' style='PLAIN' topToBottom='true'/>
        </Text>
      </Shape>
      <Collision bboxCenter='0 0 0' bboxSize='-1 -1 -1' containerField='children' enabled='true'>
        <!-- test containerField='proxy' -->
        <Shape DEF='ProxyShape' bboxCenter='0 0 0' bboxSize='-1 -1 -1' containerField='proxy'>
          <!-- alternative XML encoding: Text string='"One, Two, Comment" "" "He said, \&quot;Immel did it!\&quot;"' -->
          <!-- alternative XML encoding: Text string='"One, Two, Comment" "" "He said, \&quot;Immel did it!\&quot;" ""' -->
          <!-- alternative Java source: .setString(new String [] {"One, Two, Comment", "", "He said, \"Immel did it!\""}) -->
          <!-- reference: http://www.web3d.org/x3d/content/examples/Basic/X3dSpecifications/StringArrayEncodingExamplesIndex.html -->
          <Text containerField='geometry' maxExtent='0.0' solid='false' string='"One, Two, Text" "" "He said, \"Immel did it!\" \"\""'/>
        </Shape>
      </Collision>
      <!-- It's a beautiful world -->
      <!-- ... for you! -->
      <!-- https://en.wikipedia.org/wiki/Beautiful_World_(Devo_song) -->
    </Transform>
    <!-- repeatedly spin 180 degrees as a readable special effect -->
    <OrientationInterpolator DEF='SpinInterpolator' containerField='children' keyValue='0 1 0 4.712389 0 1 0 0 0 1 0 1.5707964'/>
    <TimeSensor DEF='SpinClock' containerField='children' cycleInterval='5.0' enabled='true' loop='true' pauseTime='0' resumeTime='0' startTime='0' stopTime='0'/>
    <ROUTE fromField='fraction_changed' fromNode='SpinClock' toField='set_fraction' toNode='SpinInterpolator'/>
    <ROUTE fromField='value_changed' fromNode='SpinInterpolator' toField='rotation' toNode='TextTransform'/>
    <Group DEF='BackgroundGroup' bboxCenter='0 0 0' bboxSize='-1 -1 -1' containerField='children'>
      <Background DEF='GradualBackground' containerField='children' skyColor='0 0 0' transparency='0'/>
      <Script DEF='colorTypeConversionScript' containerField='children' directOutput='false' mustEvaluate='false'>
        <field accessType='inputOnly' name='colorInput' type='SFColor'/>
        <field accessType='outputOnly' name='colorsOutput' type='MFColor'/>
        <![CDATA[
ecmascript:

function colorInput (eventValue) // Example source code
{
   colorsOutput = new MFColor(eventValue); // assigning value sends output event
// Browser.print('colorInput=' + eventValue + ', colorsOutput=' + colorsOutput + '\n');
}
]]>
      </Script>
      <ColorInterpolator DEF='ColorAnimator' containerField='children' keyValue='0.9411765 1 1 0.29411766 0 0.50980395 0.9411765 1 1'>
        <!-- AZURE to INDIGO and back again -->
      </ColorInterpolator>
      <TimeSensor DEF='ColorClock' containerField='children' cycleInterval='60.0' enabled='true' loop='true' pauseTime='0' resumeTime='0' startTime='0' stopTime='0'/>
      <ROUTE fromField='colorsOutput' fromNode='colorTypeConversionScript' toField='skyColor' toNode='GradualBackground'/>
      <ROUTE fromField='value_changed' fromNode='ColorAnimator' toField='colorInput' toNode='colorTypeConversionScript'/>
      <ROUTE fromField='fraction_changed' fromNode='ColorClock' toField='set_fraction' toNode='ColorAnimator'/>
    </Group>
    <ProtoDeclare appinfo='tooltip: ArtDeco01Material prototype is a Material node' name='ArtDeco01Material'>
      <ProtoInterface>
        <field accessType='inputOutput' appinfo='tooltip for descriptionField' name='description' type='SFString' value='ArtDeco01Material prototype is a Material node'/>
        <field accessType='inputOutput' name='enabled' type='SFBool' value='true'/>
      </ProtoInterface>
      <ProtoBody>
        <!-- Initial node of ProtoBody determines prototype node type -->
        <Material ambientIntensity='0.25' containerField='material' diffuseColor='0.282435 0.085159 0.134462' emissiveColor='0 0 0' shininess='0.127273' specularColor='0.276305 0.11431 0.139857' transparency='0'/>
        <!-- [HelloWorldProgram diagnostic] should be connected to scene graph: artDeco01ProtoDeclare.getNodeType()="Material" -->
        <!-- presence of follow-on TouchSensor shows that additional nodes are allowed in ProtoBody after initial node, regardless of node types -->
        <TouchSensor containerField='children' description='within ProtoBody' enabled='true'>
          <IS>
            <connect nodeField='description' protoField='description'/>
            <connect nodeField='enabled' protoField='enabled'/>
          </IS>
        </TouchSensor>
      </ProtoBody>
    </ProtoDeclare>
    <ExternProtoDeclare appinfo='this is a different Material node' name='ArtDeco02Material' url='"http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter14Prototypes/ArtDecoPrototypesExcerpt.x3d#ArtDeco02Material" "http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter14Prototypes/ArtDecoPrototypesExcerpt.x3dv#ArtDeco02Material"'>
      <!-- [HelloWorldProgram diagnostic] artDeco02ExternProtoDeclare.getNodeType()="ERROR_UNKNOWN_EXTERNPROTODECLARE_NODE_TYPE: ExternProtoDeclare name='ArtDeco02Material' type cannot be remotely accessed at run time. TODO X3DJSAIL needs to add further capability that retrieves the ExternProtoDeclare file." -->
      <field accessType='inputOutput' appinfo='tooltip for descriptionField' name='description' type='SFString'/>
    </ExternProtoDeclare>
    <!-- Tested ArtDeco01ProtoInstance, ArtDeco02ProtoInstance for improper node type when ProtoInstance is added in wrong place -->
    <Shape DEF='TestShape1' bboxCenter='0 0 0' bboxSize='-1 -1 -1' containerField='children'>
      <Appearance DEF='TestAppearance1' containerField='appearance'>
        <!-- ArtDeco01Material prototype goes here... TODO ensure setContainerField is handled in exported Java -->
        <ProtoInstance containerField='material' name='ArtDeco01Material'>
          <!-- [HelloWorldProgram diagnostic] ArtDeco01ProtoInstance.getNodeType()="Material" -->
          <fieldValue name='description' value='ArtDeco01Material can substitute for a Material node'/>
        </ProtoInstance>
      </Appearance>
      <Sphere containerField='geometry' radius='0.001' solid='true'/>
    </Shape>
    <Shape DEF='TestShape2' bboxCenter='0 0 0' bboxSize='-1 -1 -1' containerField='children'>
      <Appearance DEF='TestAppearance2' containerField='appearance'>
        <!-- ArtDeco02Material prototype goes here... TODO ensure setContainerField is handled in exported Java -->
        <ProtoInstance DEF='ArtDeco02MaterialDEF' containerField='material' name='ArtDeco02Material'>
          <!-- [HelloWorldProgram diagnostic] ArtDeco02ProtoInstance.getNodeType()="ERROR_UNKNOWN_EXTERNPROTODECLARE_NODE_TYPE: ExternProtoDeclare name='ArtDeco02Material' type cannot be remotely accessed at run time. TODO X3DJSAIL needs to add further capability that retrieves the ExternProtoDeclare file." -->
          <fieldValue name='description' value='ArtDeco02Material can substitute for another Material node'/>
        </ProtoInstance>
      </Appearance>
      <Cone bottom='true' bottomRadius='0.001' containerField='geometry' height='0.001' side='true' solid='true'/>
    </Shape>
    <Shape DEF='TestShape3' bboxCenter='0 0 0' bboxSize='-1 -1 -1' containerField='children'>
      <Appearance DEF='TestAppearance3' containerField='appearance'>
        <!-- ArtDeco02Material ProtoInstance USE goes here... -->
        <ProtoInstance USE='ArtDeco02MaterialDEF' containerField='material'/>
      </Appearance>
      <Cylinder bottom='true' containerField='geometry' height='0.001' radius='0.001' side='true' solid='true' top='true'/>
    </Shape>
    <Inline DEF='inlineSceneDef' bboxCenter='0 0 0' bboxSize='-1 -1 -1' containerField='children' load='true' url='"someOtherScene.x3d"'/>
    <IMPORT AS='WorldInfoDEF2' importedDEF='WorldInfoDEF' inlineDEF='inlineSceneDef'/>
    <EXPORT AS='WorldInfoDEF3' localDEF='WorldInfoDEF'/>
    <ProtoDeclare appinfo='mimic a Material node and modulate fields as an animation effect' documentation='http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter14Prototypes/MaterialModulatorIndex.html' name='MaterialModulator'>
      <ProtoInterface>
        <field accessType='inputOutput' name='enabled' type='SFBool' value='true'/>
        <field accessType='inputOutput' name='diffuseColor' type='SFColor' value='0 0 0'/>
        <field accessType='inputOutput' name='emissiveColor' type='SFColor' value='0.05 0.05 0.5'/>
        <field accessType='inputOutput' name='specularColor' type='SFColor' value='0 0 0'/>
        <field accessType='inputOutput' name='transparency' type='SFFloat' value='0.0'/>
        <field accessType='inputOutput' name='shininess' type='SFFloat' value='0.0'/>
        <field accessType='inputOutput' name='ambientIntensity' type='SFFloat' value='0.0'/>
      </ProtoInterface>
      <ProtoBody>
        <Material DEF='MaterialNode' ambientIntensity='0.2' containerField='material' diffuseColor='0.8 0.8 0.8' emissiveColor='0 0 0' shininess='0.2' specularColor='0 0 0' transparency='0'>
          <IS>
            <connect nodeField='diffuseColor' protoField='diffuseColor'/>
            <connect nodeField='emissiveColor' protoField='emissiveColor'/>
            <connect nodeField='specularColor' protoField='specularColor'/>
            <connect nodeField='transparency' protoField='transparency'/>
            <connect nodeField='shininess' protoField='shininess'/>
            <connect nodeField='ambientIntensity' protoField='ambientIntensity'/>
          </IS>
        </Material>
        <!-- Only first node (the node type) is renderable, others are along for the ride -->
        <Script DEF='MaterialModulatorScript' containerField='children' directOutput='false' mustEvaluate='false'>
          <field accessType='inputOutput' name='enabled' type='SFBool'/>
          <field accessType='inputOutput' name='diffuseColor' type='SFColor'/>
          <field accessType='outputOnly' name='newColor' type='SFColor'/>
          <field accessType='inputOnly' name='clockTrigger' type='SFTime'/>
          <IS>
            <connect nodeField='enabled' protoField='enabled'/>
            <connect nodeField='diffuseColor' protoField='diffuseColor'/>
          </IS>
          <![CDATA[
ecmascript:
function initialize ()
{
    newColor = diffuseColor; // start with correct color
}
function set_enabled (newValue)
{
	enabled = newValue;
}
function clockTrigger (timeValue)
{
    if (!enabled) return;
    red   = newColor.r;
    green = newColor.g;
    blue  = newColor.b;
    
    // note different modulation rates for each color component, % is modulus operator
    newColor = new SFColor ((red + 0.02) % 1, (green + 0.03) % 1, (blue + 0.04) % 1);
	if (enabled)
	{
		Browser.print ('diffuseColor=(' + red + ',' + green + ',' + blue + ') newColor=' + newColor.toString() + '\n');
	}
}
]]>
        </Script>
      </ProtoBody>
    </ProtoDeclare>
    <!-- Test success: declarative statement createDeclarativeShapeTests() -->
    <Group DEF='DeclarativeGroupExample' bboxCenter='0 0 0' bboxSize='-1 -1 -1' containerField='children'>
      <Shape bboxCenter='0 0 0' bboxSize='-1 -1 -1' containerField='children'>
        <MetadataString DEF='FindableMetadataStringTest' containerField='metadata' name='findThisNameValue' value='"test case"'/>
        <Appearance DEF='DeclarativeAppearanceExample' containerField='appearance'>
          <!-- DeclarativeMaterialExample gets overridden by subsequently added MaterialModulator ProtoInstance -->
          <ProtoInstance DEF='MyMaterialModulator' containerField='material' name='MaterialModulator'/>
        </Appearance>
        <Cone bottom='false' bottomRadius='0.05' containerField='geometry' height='0.1' side='true' solid='true'/>
      </Shape>
      <!-- Test success: declarativeGroup.addChild() singleton pipeline method -->
    </Group>
    <!-- Test success: declarative statement addChild() -->
    <!-- Test success: x3dModel.findNodeByDEF(DeclarativeAppearanceExample) = <Appearance DEF='DeclarativeAppearanceExample'/> i.e. <Appearance DEF='DeclarativeAppearanceExample'> <!- - DeclarativeMaterialExample gets overridden by subsequently added MaterialModulator ProtoInstance - -> <ProtoInstance DEF='MyMaterialModulator' name='MaterialModulator' containerField='material'/> </Appearance> -->
    <!-- Test success: x3dModel.findElementByNameValue(findThisNameValue) = <MetadataString DEF='FindableMetadataStringTest' name='findThisNameValue' value='"test case"'/> -->
    <!-- Test success: x3dModel.findElementByNameValue("ArtDeco01Material", "ProtoDeclare") found -->
    <!-- Test success: x3dModel.findElementByNameValue("MaterialModulator", "ProtoDeclare") found -->
    <!-- Test success: x3dModel.findElementByNameValue("MaterialModulator", "ProtoInstance") found -->
    <Group DEF='TestFieldObjectsGroup' bboxCenter='0 0 0' bboxSize='-1 -1 -1' containerField='children'>
      <!-- testFieldObjects() results -->
      <!-- SFBool default=true, true=true, false=false, negate()=true -->
      <!-- MFBool default=, initial=true false true, negate()=false true false -->
      <!-- SFFloat default=0.0, initial=1.0, setValue(2)=2.0, setValue(3.0f)=3.0, setValue(4.0)=4.0 -->
      <!-- MFFloat default=, initial=1 2 3, append(5)=1 2 3 5, inserts(3,4)(0,0)=0 1 2 3 4 5, append(6)=0 1 2 3 4 5 6, size()=7 -->
      <!-- ... get1Value[3]=3.0, remove[1]=0 2 3 4 5 6, set1Value(0,10)=10 2 3 4 5 6, multiply(2)=20 4 6 8 10 12, clear= -->
      <!-- SFVec3f default=0 0 0, initial=1 2 3, setValue=4 5 6, multiply(2)=8 10 12, normalize()=0.45584232 0.5698029 0.68376344, regex matches()=true -->
      <!-- regex test SFVec3f().matches("1 2 3")=true, regex test SFVec3f().matches("1 2 3 4")=false, regex test (SFRotationObject.matches("0 0 0 0")=true, failure detecting illegal (zero axis) rotation value -->
    </Group>
    <Sound containerField='children' direction='0 0 1' intensity='1' location='0 1.6 0' maxBack='10' maxFront='10' minBack='1' minFront='1' priority='0' spatialize='true'>
      <!-- set sound-ellipsoid location height at 1.6m to match typical avatar height -->
      <AudioClip containerField='source' description='chimes' loop='false' pauseTime='0' pitch='1.0' resumeTime='0' startTime='0' stopTime='0' url='"chimes.wav" "http://www.web3d.org/x3d/content/examples/ConformanceNist/Sounds/AudioClip/chimes.wav"'>
        <!-- Scene example fragment from http://www.web3d.org/x3d/content/examples/ConformanceNist/Sounds/AudioClip/default.x3d -->
      </AudioClip>
    </Sound>
    <Sound containerField='children' direction='0 0 1' intensity='1' location='0 1.6 0' maxBack='10' maxFront='10' minBack='1' minFront='1' priority='0' spatialize='true'>
      <!-- set sound-ellipsoid location height at 1.6m to match typical avatar height -->
      <MovieTexture containerField='source' description='mpgsys.mpg from ConformanceNist suite' loop='false' pauseTime='0' repeatS='true' repeatT='true' resumeTime='0' speed='1.0' startTime='0' stopTime='0' url='"mpgsys.mpg" "http://www.web3d.org/x3d/content/examples/ConformanceNist/Appearance/MovieTexture/mpgsys.mpg"'>
        <!-- Scene example fragment from http://www.web3d.org/x3d/content/examples/ConformanceNist/Appearance/MovieTexture/mpeg1-systems.x3d -->
        <!-- Expected containerField='source', allowed containerField values="texture" "source" "back" "bottom" "front" "left" "right" "top" "backTexture" "bottomTexture" "frontTexture" "leftTexture" "rightTexture" "topTexture" "watchList" -->
      </MovieTexture>
    </Sound>
    <!-- Test success: AnchorObject.isNode()=true, siteAnchor.isNode()=true -->
    <!-- Test success: AnchorObject.isStatement()=false, siteAnchor.isStatement()=false -->
    <!-- Test success: ROUTEObject.isNode()=false, orbitPositionROUTE.isNode()=false -->
    <!-- Test success: ROUTEObject.isStatement()=true, orbitPositionROUTE.isStatement()=true -->
    <!-- Test success: CommentsBlock.isNode()=false, testComments.isNode()=false -->
    <!-- Test failure: CommentsBlock.isStatement()=true, testComments.isStatement()=true -->
    <Shape DEF='ExtrusionShape' bboxCenter='0 0 0' bboxSize='-1 -1 -1' containerField='children'>
      <!-- ExampleExtrusion isCrossSectionClosed()=true, crossSection='[1.0, 1.0, 1.0, -1.0, -1.0, -1.0, -1.0, 1.0, 1.0, 1.0]' -->
      <!-- ExampleExtrusion isSpineClosed()=false, spine='[0.0, 0.0, 0.0, 0.0, 1.0, 0.0]' -->
      <Appearance DEF='TransparentAppearance' containerField='appearance'>
        <Material ambientIntensity='0.2' containerField='material' diffuseColor='0.8 0.8 0.8' emissiveColor='0 0 0' shininess='0.2' specularColor='0 0 0' transparency='1.0'/>
      </Appearance>
      <Extrusion DEF='ExampleExtrusion' beginCap='true' ccw='true' containerField='geometry' convex='true' creaseAngle='0.0' crossSection='1 1 1 -1 -1 -1 -1 1 1 1' endCap='true' orientation='0 0 1 0' scale='1 1' solid='true' spine='0 0 0 0 1 0'/>
    </Shape>
  </Scene>
</X3D>
===========================================
Test success: x3dLoader.getDomDocument() and x3dLoader.toStringX3D(domDocument)
Now test x3dLoader.toX3dObjectTree(domDocument)
Warning: toFileX3D() is overwriting prior file HelloWorldProgramOutput_ReloadedDOM.x3d
Test success: x3dLoader.toX3dObjectTree(domDocument), save HelloWorldProgramOutput_ReloadedDOM.x3d
x3dLoader validation result: no issues reported.
===========================================
Test loadModelFromFileX3D(String) and loadModelFromFileX3D(File)
checking both .x3d and .xml encodings:
newX3DModel loadSuccess=true, isEmpty()=false, validate()=success
===========================================
===========================================
Check file sizes for various forms of compression
Source file HelloWorldProgramOutput.x3d 21231 bytes
===========================================
Test toFileEXI() with EXIficient
Warning: HelloWorldProgramOutput_EXIFICIENT.exi.temp.x3d does not meet suggested X3D naming conventions, output serialization continuing...
HelloWorldProgramOutput_EXIFICIENT.exi  filesize 2994 bytes, compression 14.10% of original
===========================================
Test fromFileEXI() with EXIficient
Warning: fromFileEXI() is overwriting prior file HelloWorldProgramOutput_EXIFICIENT.exi
gunzipped temp.exiInputTransformed.x3d size=16632 bytes
  fromFileEXIsuccess=true for HelloWorldProgramOutput_EXIFICIENT.exi
exiModel.validate() results: success
===========================================
Test toFileEXI() with OpenEXI: not yet implemented
===========================================
Test fromFileEXI() with OpenEXI: not yet implemented
===========================================
Test toFileGZIP()
HelloWorldProgramOutput.gz  filesize 5403 bytes, compression 25.45% of original
===========================================
Test toFileZip()
HelloWorldProgramOutput.zip filesize 5649 bytes, compression 26.61% of original
===========================================
===========================================
Test CommandLine invocations
CommandLine [-help]
Usage: java [-classpath X3DJSAIL.*.jar] org.web3d.x3d.jsail.CommandLine [sourceModel.x3d | package.path.ProgramName | -help | -page | -resources | -tooltips]
       [-tofile [resultFile.*]] [-properties [propertiesFile]] [-validate]
       [sourceModel.exi -fromEXI] [sourceModel.gz -fromGZIP] [sourceModel.zip -fromZIP]
       [-toX3D | -toXML | -toHTML | -toMarkdown | -toTidy | -toClassicVrml | -toJava | -toJSON | -toVRML97 | -toX3DOM | -toX_ITE | -toEXI | -toGZIP | -toZIP]
===========================================
CommandLine [HelloWorldProgramOutput.x3d, -toX3D, -toFile, HelloWorldProgramOutput_CommandLine.x3d]
parameter: source file HelloWorldProgramOutput.x3d filesize 21231 bytes, parsed using Document Object Model (DOM) X3DLoader
parameter: "-toX3D" for conversion to X3D encoding
parameter: "-toFile" "HelloWorldProgramOutput_CommandLine.x3d" for result file name root HelloWorldProgramOutput_CommandLine
convert to X3D:
Warning: toFileX3D() is overwriting prior file HelloWorldProgramOutput_CommandLine.x3d
file conversion successful: HelloWorldProgramOutput_CommandLine.x3d (21266 bytes)
===========================================
CommandLine [HelloWorldProgramOutput.x3d, -toMarkdown, -toFile, HelloWorldProgramOutputCatalog.md]
parameter: source file HelloWorldProgramOutput.x3d filesize 21231 bytes, parsed using Document Object Model (DOM) X3DLoader
parameter: "-toMarkdown" for producing .md model meta information markdown
parameter: "-toFile" "HelloWorldProgramOutputCatalog.md" for result file name root HelloWorldProgramOutputCatalog
convert to .md model meta information markdown, include subdirectories in meta links: true
Warning: toFileStylesheetConversion(X3dModelMetaToMarkdown.xslt) is overwriting prior file HelloWorldProgramOutputCatalog.md
file conversion successful: HelloWorldProgramOutputCatalog.md (2119 bytes)
===========================================
CommandLine [HelloWorldProgramOutput.x3d, -toMarkdownFlatten, -toFile, HelloWorldProgramOutput.md]
parameter: source file HelloWorldProgramOutput.x3d filesize 21231 bytes, parsed using Document Object Model (DOM) X3DLoader
parameter: "-toMarkdownFlatten" for producing .md model meta information markdown with flattened (omitted) subdirectories
parameter: "-toFile" "HelloWorldProgramOutput.md" for result file name root HelloWorldProgramOutput
convert to .md model meta information markdown, include subdirectories in meta links: false
Warning: toFileStylesheetConversion(X3dModelMetaToMarkdown.xslt) is overwriting prior file HelloWorldProgramOutput.md
file conversion successful: HelloWorldProgramOutput.md (2116 bytes)
===========================================
CommandLine [HelloWorldProgramOutput.x3d, -EXIFICIENT, -toEXI, -toFile, HelloWorldProgramOutput_CommandLine_EXIFICIENT.exi]
parameter: source file HelloWorldProgramOutput.x3d filesize 21231 bytes, parsed using Document Object Model (DOM) X3DLoader
parameter: "-EXIFICIENT" invoked  ConfigurationProperties.setExiEngine(EXIFICIENT);
parameter: "-toEXI" for conversion to compressed EXI containing model
parameter: "-toFile" "HelloWorldProgramOutput_CommandLine_EXIFICIENT.exi" for result file name root HelloWorldProgramOutput_CommandLine_EXIFICIENT
convert to EXI using EXIFICIENT:
source: HelloWorldProgramOutput.x3d filesize 21231 bytes
Warning: HelloWorldProgramOutput_CommandLine_EXIFICIENT.exi.temp.x3d does not meet suggested X3D naming conventions, output serialization continuing...
result: HelloWorldProgramOutput_CommandLine_EXIFICIENT.exi filesize 2994 bytes, compression 14.10% of original
===========================================
CommandLine [HelloWorldProgramOutput.x3d, -OpenEXI]
parameter: source file HelloWorldProgramOutput.x3d filesize 21231 bytes, parsed using Document Object Model (DOM) X3DLoader
parameter: "-OpenEXI" invoked  ConfigurationProperties.setExiEngine(OPENEXI);
  Warning: "OPENEXI" option not yet implemented, using EXIFICIENT instead.
===========================================
CommandLine [HelloWorldProgramOutput.x3d, -toGZIP, -toFile, HelloWorldProgramOutput_CommandLine.x3d.gz]
parameter: source file HelloWorldProgramOutput.x3d filesize 21231 bytes, parsed using Document Object Model (DOM) X3DLoader
parameter: "-toGZIP" for conversion to compressed GZIP containing model
parameter: "-toFile" "HelloWorldProgramOutput_CommandLine.x3d.gz" for result file name root HelloWorldProgramOutput_CommandLine.x3d
convert to GZIP:
source: HelloWorldProgramOutput.x3d filesize 21231 bytes
result: HelloWorldProgramOutput_CommandLine.x3d.gz  filesize 5403 bytes, compression 25.45% of original
===========================================
CommandLine [HelloWorldProgramOutput_CommandLine.x3d.gz, -fromGZIP]
parameter: source file HelloWorldProgramOutput_CommandLine.x3d.gz filesize 5403 bytes
parameter: "-fromGZIP" for conversion from compressed GZIP containing model
  fromFileGZIP() output modelFileName HelloWorldProgramOutput_CommandLine.x3d
Warning: fromFileGZIP() is overwriting prior file HelloWorldProgramOutput_CommandLine.x3d
gunzipped HelloWorldProgramOutput_CommandLine.x3d size=21266 bytes
load success: true
===========================================
CommandLine [HelloWorldProgramOutput.x3d, -toZIP, -toFile, HelloWorldProgramOutput_CommandLine.x3d.zip]
parameter: source file HelloWorldProgramOutput.x3d filesize 21231 bytes, parsed using Document Object Model (DOM) X3DLoader
parameter: "-toZIP" for conversion to compressed ZIP containing model
parameter: "-toFile" "HelloWorldProgramOutput_CommandLine.x3d.zip" for result file name root HelloWorldProgramOutput_CommandLine.x3d
convert to ZIP:
source: HelloWorldProgramOutput.x3d filesize 21231 bytes
result: HelloWorldProgramOutput_CommandLine.x3d.zip filesize 5649 bytes, compression 26.61% of original
===========================================
CommandLine [HelloWorldProgramOutput_CommandLine.x3d.zip, -fromZIP, -toFile, HelloWorldProgramOutput_CommandLineUnzipped.x3d]
parameter: source file HelloWorldProgramOutput_CommandLine.x3d.zip filesize 5649 bytes
parameter: "-fromZIP" for conversion from compressed ZIP containing model
parameter: "-toFile" "HelloWorldProgramOutput_CommandLineUnzipped.x3d" for result file name root HelloWorldProgramOutput_CommandLineUnzipped
Warning: fromFileZIP() modelFileName was empty, unzipping found initial X3D file to load: HelloWorldProgramOutput.x3d
Warning: fromFileZIP() is overwriting prior file HelloWorldProgramOutput_CommandLineUnzipped.x3d
Unzipped HelloWorldProgramOutput_CommandLineUnzipped.x3d size=21266 bytes
load success: true
===========================================
x3dModel.validate() results with ConfigurationProperties.setDebugModeActive(true): 
ProtoInstance ArtDeco01Material DEF='' has corresponding ProtoDeclare
ProtoInstance ArtDeco02Material DEF='ArtDeco02MaterialDEF' has corresponding ExternProtoDeclare
ProtoInstance MaterialModulator DEF='MyMaterialModulator' has corresponding ProtoDeclare

===========================================
HelloWorldProgram complete.
===========================================
testBlenderLauncher();  // check Blender capabilities
Blender default path=[not set]
Blender.checkBlenderPath() new path=C:\Program Files\Blender Foundation\Blender\
BlenderLauncher.hasBlender()=true
Blender version=Blender 2.79 (sub 0)
	build date: Mon 09/11/2017
	build time: 07:44 AM
	build commit date: 2017-09-11
	build commit time: 10:43
	build hash: 5bd8ac9
	build platform: Windows
	build type: 
	build c flags: /W3 /w34062 /wd4018 /wd4146 /wd4065 /wd4127 /wd4181 /wd4200 /wd4244 /wd4267 /wd4305 /wd4800 /we4013 /we4431 /DWIN32 /D_WINDOWS /W3 /nologo /J /Gd /MP /openmp     
	build c++ flags: /W3 /w34062 /wd4018 /wd4146 /wd4065 /wd4127 /wd4181 /wd4200 /wd4244 /wd4267 /wd4305 /wd4800 /we4013 /we4431 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /nologo /J /Gd /MP /EHsc /openmp     
	build link flags: /MACHINE:X64 /SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO  /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcmrt.lib /NODEFAULTLIB:msvcurt.lib /NODEFAULTLIB:msvcrtd.lib  /ignore:4049 /ignore:4217 /ignore:4221
	build system: CMake

===========================================
===========================================
testMeshLabLauncher();  // check MeshLab capabilities
MeshLab default path=[not set]
MeshLab.checkMeshLabPath() new path=C:\Program Files\VCG\MeshLab\
=================================
MeshLabLauncher.hasMeshLab()=true
=================================
MeshLabLauncher.getMeshLabVersion()=MeshLab version is not a currently supported feature. See https://meshLab.net

Usage:
meshlabserver [logargs] [args]

  where logargs can be:

    -d filename             dump on a text file a list of all the

                            filtering functions

    -l filename             log of the filters is ouput on a file

  where args can be:

    -p filename             meshlab project (.mlp) to be loaded

    -w filename [-x]        output meshlab project (.mlp) to be saved.

                            If -x flag is specified a 3D model meshfile.ext

                            contained in the input project will be overwritten,

                            otherwise it will be saved in the same directory of

                            input mesh as a new file called meshfile_out.ext.

                            All the mesh attributes will be exported in the

                            saved files

    -i filename             mesh that has to be loaded

    -o filename [-m <opt>]  the name of the file where to write the current mesh

                            of the MeshLab document.

                            If -m is specified  the specified mesh attributes will

                            be saved in the output file. the param <opt> can be a

                            space separated list of the following attributes:

                                vc -> vertex colors,  vf -> vertex flags,

                                vq -> vertex quality, vn-> vertex normals,

                                vt -> vertex texture coords,

                                fc -> face colors,  ff -> face flags,

                                fq -> face quality, fn-> face normals,

                                wc -> wedge colors, wn-> wedge normals,

                                wt -> wedge texture coords

    -s filename		          the script to be applied



   Examples:



    'meshlabserver -i input.obj -o output.ply -m vc fq wt -s meshclean.mlx'

           the script contained in file 'meshclean.mlx' will be applied to the

           mesh contained into 'input.obj'. The vertex coordinates and the

           per-vertex-color, the per-face-quality and the per-wedge-texture

           attributes will be saved into the output.ply file



    'meshlabserver -i input0.obj -i input1.ply -w outproj.mlp -x -s meshclean.mlx'

           the script file meshclean.mlx will be applied to the document

           composed by input0.obj and input1.ply meshes.

           The mesh input1.ply will become the current mesh of the document

           (e.g. the mesh to which the filters operating on a single model will

           be applied). A new output project outproj.mlp file will be generated

           (containing references to the input0.obj an input1.ply).

           The files input0.obj and input1.ply will be overwritten.



    'meshlabserver -l logfile.txt -p proj.mlp -i input.obj -w outproj.mlp -s meshclean.mlx'

           the mesh file input.obj will be added to the meshes referred by the

           loaded meshlab project file proj.mlp. The mesh input.obj will become

           the current mesh of the document, the script file meshclean.mlx will

           be applied to the meshes contained into the resulting document.

           the project file outproj.mlp will be generated

           A 3D model meshfile.ext contained in the input project proj.mlp will

           be saved in a new file called meshfile_out.ext

           (if you want to overwrite the original files use the -v flag after

           the outproject filename) all the attributes of the meshes will be

           saved into the output files; the log info will be saved into the

           file logfile.txt.



   Notes:

   There can be multiple meshes loaded and the order they are listed matters because

   filters that use meshes as parameters choose the mesh based on the order.

   The format of the output mesh is guessed by the used extension.

   Script is optional and must be in the xml format saved by MeshLab.




MeshLabLauncher.convertModel(".", "CleatClamp.stl", "CleatClamp_RoundTrip.stl");
meshlabserver.exe -l .\CleatClamp_RoundTrip.MeshLab.log.txt -i .\CleatClamp.stl -o .\CleatClamp_RoundTrip.stl
MeshLabLauncher.wasPriorCommandSuccessful()=false conversionResult=false
meshLabLauncher.importModel(".", "CleatClamp.stl"); produces CleatClamp.MeshLab.x3d and CleatClamp.MeshLab.log.txt
meshlabserver.exe -l .\CleatClamp.MeshLab.log.txt -i .\CleatClamp.stl -o .\CleatClamp.MeshLab.x3d
meshLabLauncher.getPriorMeshLabTraceLogFileName()=.\CleatClamp.MeshLab.log.txt
meshLabLauncher.getPriorMeshLabTraceLogContents()=
[Mesh C:/x3d-code/www.web3d.org/x3d/stylesheets/java/examples/CleatClamp.stl loaded has 8736 vn 2912 fn, output mesh  C:/x3d-code/www.web3d.org/x3d/stylesheets/java/examples/CleatClamp.MeshLab.x3d, Mesh C:/x3d-code/www.web3d.org/x3d/stylesheets/java/examples/CleatClamp.stl saved as C:/x3d-code/www.web3d.org/x3d/stylesheets/java/examples/CleatClamp.MeshLab.x3d (8736 vn 2912 fn)]
[debug] Output file path=C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples\HelloWorldProgramOutput_MeshLabImport.x3d

Warning: toFileX3D() is overwriting prior file HelloWorldProgramOutput_MeshLabImport.x3d
===========================================
===========================================
HelloWorldProgram self validation: success
===========================================
Quick test of CommandLine capability:
Usage: java [-classpath X3DJSAIL.*.jar] org.web3d.x3d.jsail.CommandLine [sourceModel.x3d | package.path.ProgramName | -help | -page | -resources | -tooltips]
       [-tofile [resultFile.*]] [-properties [propertiesFile]] [-validate]
       [sourceModel.exi -fromEXI] [sourceModel.gz -fromGZIP] [sourceModel.zip -fromZIP]
       [-toX3D | -toXML | -toHTML | -toMarkdown | -toTidy | -toClassicVrml | -toJava | -toJSON | -toVRML97 | -toX3DOM | -toX_ITE | -toEXI | -toGZIP | -toZIP]
===========================================
compile HelloWorldProgramOutput.java source...
     (i.e. new source program which was just produced by HelloWorldProgram execution)
Compiling 1 source file to C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples
test HelloWorldProgramOutput execution and self-validation:
Java program "HelloWorldProgramOutput" self-validation test results: success
Deleting: C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples\HelloWorldProgramOutput.class
===========================================
Error checking with jslint: C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutput.json
jslint:C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutput.json:466:1:JavaScript URL.
jslint:C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutput.json:864:1:JavaScript URL.
Java Result: 1
Error checking with json-schema-validator: C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples/HelloWorldProgramOutput.json
Schema is invalid! Aborting...
Java Result: 101
===========================================
HelloWorldProgramOutput.x3d
1 file(s) have been successfully validated.
1 file(s) have been successfully validated.
===========================================
HelloWorldProgramOutput_CommandLine.x3d
1 file(s) have been successfully validated.
1 file(s) have been successfully validated.
matches HelloWorldProgramOutput.x3d: false
===========================================
HelloWorldProgramOutput.xml
1 file(s) have been successfully validated.
1 file(s) have been successfully validated.
matches HelloWorldProgramOutput.x3d: true
===========================================
HelloWorldProgramOutput_ReloadedDOM.x3d
1 file(s) have been successfully validated.
1 file(s) have been successfully validated.
matches HelloWorldProgramOutput.x3d: false
===========================================
BUILD SUCCESSFUL (total time: 1 minute 25 seconds)
