[x3d-public] potential error in X3dToJava.xslt (setLang not called for meta statements.
John Carlson
yottzumm at gmail.com
Fri Nov 19 14:05:04 PST 2021
Here's the Teapot.java I was referring to:
https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/java/net/x3djsonld/data/Teapot.java.
I verified my in email was a git diff. The filenames are in the first
few lines.
I will look for updates.
Parallel to your code, my checked in Teapot.java, created with
stylesheets, looks like:
.setDir("").setHttp_equiv("")/* xml:lang='' */.setScheme(""))
I will look further into your referenced build.xml, I'm looking more for
how to do more than one file (validating with Java) *and* do to do a
single file validator. I already have code to do Saxon stuff.
I have one more comment below.
John
On 11/19/21 03:56, Brutzman, Donald (Don) (CIV) wrote:
>
> Thanks for report. Not sure what change or problem you are reporting
> however. Further you mention Teapot but then show another example,
> Mooring Buoy. Hmmm.
>
> I suspect that you are getting things like
> setDir("").setHttp_equiv("").setLang("").setScheme("") because you do
> not have Saxon invocation set to strip default attribute values.
>
> Excerpt from
> https://x3dgraphics.com/examples/X3dForAdvancedModeling/build.xml
> showing invocation parameters
>
> <!-- process individual files here. show full
> path to facilitate user loading, editing of reported files -->
>
> <echo>${archive.path}/${relative.path1}/${relative.path2}/${name.short}.x3d
> converted to ${name.short}.java</echo>
>
> <!-- Saxon10 is locally defined macro -->
>
> <Saxon10
> scene="${relative.path1}/${relative.path2}/${name.short}"
>
> stylesheet="${stylesheet.dir}/X3dToJava"
>
> parameterPair1="packageName=${archive.name}.${relative.path1}${relative.path2}"
>
> parameterPair2= "className=${name.short}"
>
> parameterPair3="includeLicense=true"
>
> suffix=""
>
> extension="java"
>
> expand="on"/>
>
> <!-- expand:on since DTD defaults needed -->
>
> <!-- <echo message="... compiling ${name.short}.java"/> -->
>
> <javac srcdir="${relative.path1}/${relative.path2}/"
>
> includes="${name.short}.java"
>
> classpath="${x3djsail.stylesheets.dir}/${jsai.full.archive.jar.name}"
>
> destdir="${java.classes.dir}"
>
> debug="on"
>
> source="${java.source}"
>
> target="${java.target}"
>
> verbose="${javac.verbose}"
>
> failonerror="false"
>
> includeantruntime="false">
>
> Anyway I’m not seeing what your seeing, here is my local test of Teapot:
>
> •
> https://x3dgraphics.com/examples/X3dForAdvancedModeling/GeometricShapes/TeapotIndex.html
>
> •
> https://x3dgraphics.com/examples/X3dForAdvancedModeling/GeometricShapes/TeapotIndex.x3d
>
> •
> https://x3dgraphics.com/examples/X3dForAdvancedModeling/GeometricShapes/TeapotIndex.java
>
I'm seeing TeapotIndex.java here, and Teapot.java below. Please clarify.
> ant -f
> C:\\x3d-code\\www.web3d.org\\x3d\\content\\examples\\X3dForAdvancedModeling
> processScenes.java
>
> clean.RoundTrip:
>
> ensuring any prior converted *RoundTrip*.* source files are cleaned out...
>
> processScenes.java:
>
> Verifying Apache Ant XML Catalog resolver classpath:
> C:\apache-ant-1.10.11\lib/xml-resolver-1.2.jar (84091 bytes)
>
> versions:
>
> ant -version
>
> Apache Ant(TM) version 1.10.11 compiled on July 10 2021
>
> java -version
>
> openjdk version "16" 2021-03-16
>
> OpenJDK Runtime Environment (build 16+36-2231)
>
> OpenJDK 64-Bit Server VM (build 16+36-2231, mixed mode, sharing)
>
> python -version
>
> Python 3.9.7
>
> saxon -? help
>
> Saxon-HE 10.6J from Saxonica
>
> Usage: see
> http://www.saxonica.com/documentation/index.html#!using-xsl/commandline
>
> Format: net.sf.saxon.Transform options params
>
> Options available: -? -a -catalog -config -cr -diag -dtd -ea -expand
> -explain -export -ext -im -init -it -jit -l -lib -license -m -nogo
> -now -ns -o -opt -or -outval -p -quit -r -relocate -repeat -s -sa
> -scmin -strip -t -T -target -TB -threads -TJ -Tlevel -Tout -TP
> -traceout -tree -u -val -versionmsg -warnings -x -xi -xmlversion -xsd
> -xsdversion -xsiloc -xsl -y --?
>
> Use -XYZ:? for details of option XYZ
>
> Params:
>
> param=value Set stylesheet string parameter
>
> +param=filename Set stylesheet document parameter
>
> ?param=expression Set stylesheet parameter using XPath
>
> !param=value Set serialization parameter
>
> ANT_HOME=C:\apache-ant-1.10.11
>
> JAVA_HOME=C:\Program Files\Java\openjdk\jdk-16
>
> PYTHONHOME=C:\Program Files\Python39
>
> PYTHONPATH=C:\x3d-code\www.web3d.org\x3d\stylesheets\python\x3d
>
> Check for X3DJSAIL ${jsail.full.archive.jar.name} or
> X3DJSAIL.4.0.classes.jar
>
> CLASSPATH=C:\x3d-code\www.web3d.org\x3d\stylesheets\java\jars\X3DJSAIL.4.0.full.jar;
>
> javac source/target $java.source=1.8
>
> Java/JVM version $ant.java.version=16
>
> Java/JVM detail version $java.version=16
>
> Ant version $ant.version=Apache Ant(TM) version 1.10.11
> compiled on July 10 2021
>
> Check for node.js installation from https://nodejs.org
>
> v14.17.6
>
> lib/X3DJSAIL.4.0.full.jar -version
>
> X3DJSAIL version date: 12 October 2021
>
> Configuration settings: https://savage.nps.edu/Savage/developers.html
>
> ===========================================
>
> C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForAdvancedModeling/GeometricShapes//Teapot.x3d
> converted to Teapot.java
>
> Compiling 1 source file to
> C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForAdvancedModeling\classes
>
> now run and validate the java model
>
> java -classpath
> classes;../../../stylesheets/java/jars/X3DJSAIL.4.0.full.jar
> X3dForAdvancedModeling.GeometricShapes.Teapot
>
> Java program "X3dForAdvancedModeling.GeometricShapes.Teapot"
> self-validation test results: success
>
> ===================================
>
> echo.timestamp:
>
> timestamp 01:36:46 on 19 November 2021
>
> processScenes.java complete.
>
> BUILD SUCCESSFUL (total time: 5 seconds)
>
> all the best, Don
>
> --
>
> Don Brutzman Naval Postgraduate School, Code USW/Br brutzman at nps.edu
>
> Watkins 270, MOVES Institute, Monterey CA 93943-5000 USA
> +1.831.656.2149
>
> X3D graphics, virtual worlds, navy robotics https://
> faculty.nps.edu/brutzman
>
> *From:* John Carlson <yottzumm at gmail.com>
> *Sent:* Thursday, November 18, 2021 2:31 AM
> *To:* Brutzman, Donald (Don) (CIV) <brutzman at nps.edu>; X3D Graphics
> public mailing list <x3d-public at web3d.org>
> *Subject:* potential error in X3dToJava.xslt (setLang not called for
> meta statements.
>
> Before/after difference in Teapot.java.
>
> *diff --git a/src/main/java/net/x3djsonld/data/Teapot.java
> b/src/main/java/net/x3djsonld/data/Teapot.java*
> *index a9fdb5619..3ad954bd0 100644*
> *--- a/src/main/java/net/x3djsonld/data/Teapot.java*
> *+++ b/src/main/java/net/x3djsonld/data/Teapot.java*
> @@ -88,16 +88,16 @@public class Teapot
> {
> x3dModel = new
> X3D().setProfile(X3D.PROFILE_INTERCHANGE).setVersion(X3D.VERSION_3_0)
> .setHead(new head()
> - .addMeta(new meta().setName(meta.NAME_TITLE
> ).setContent("Teapot.x3d").setDir("").setHttp_equiv("").setLang("").setScheme(""))
> - .addMeta(new meta().setName(meta.NAME_DESCRIPTION).setContent("A
> mooring buoy used in Naval
> Harbors").setDir("").setHttp_equiv("").setLang("").setScheme(""))
> - .addMeta(new meta().setName(meta.NAME_CREATOR ).setContent("LT
> Patrick Sullivan").setDir("").setHttp_equiv("").setLang("").setScheme(""))
> - .addMeta(new meta().setName(meta.NAME_CREATED ).setContent("28
> July 2006").setDir("").setHttp_equiv("").setLang("").setScheme(""))
> - .addMeta(new meta().setName(meta.NAME_MODIFIED ).setContent("12
> January 2014").setDir("").setHttp_equiv("").setLang("").setScheme(""))
> - .addMeta(new meta().setName(meta.NAME_IDENTIFIER
> ).setContent("https://savage.nps.edu/Savage/HarborEquipment/Buoys/MooringBuoy.x3d"
> <https://savage.nps.edu/Savage/HarborEquipment/Buoys/MooringBuoy.x3d>).setDir("").setHttp_equiv(""
> ).setLang("").setScheme(""))
> - .addMeta(new meta().setName(meta.NAME_GENERATOR
> ).setContent("VizX3D, http://www.vivaty.com/downloads/studio
> <https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vivaty.com%2Fdownloads%2Fstudio&data=04%7C01%7Cbrutzman%40nps.edu%7Cc0455ddce86c44084be808d9aa7e7456%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C637728282827010252%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=mmchXNoHzkTbNzFBBoCmr6PTnXtA22ROWXbBMUWj0Wc%3D&reserved=0>").setDir("").setHttp_equiv("").setLang("").setSche
> me(""))
> - .addMeta(new meta().setName(meta.NAME_GENERATOR
> ).setContent("Wings3D, http://www.wings3d.com
> <https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.wings3d.com%2F&data=04%7C01%7Cbrutzman%40nps.edu%7Cc0455ddce86c44084be808d9aa7e7456%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C637728282827020212%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=q5xJEBPJD%2BW49vmy0d8%2B0spdSV77sOYAEzuP3E%2FQ2Q0%3D&reserved=0>").setDir("").setHttp_equiv("").setLang("").setScheme(""))
> - .addMeta(new meta().setName(meta.NAME_GENERATOR
> ).setContent("X3D-Edit,
> https://savage.nps.edu/X3D-Edit").setDir("").setHttp_equiv("").setLang("").setScheme(""
> ))
> - .addMeta(new meta().setName(meta.NAME_LICENSE
> ).setContent("../../license.html").setDir("").setHttp_equiv("").setLang("").setScheme("")))
> + .addMeta(new meta().setName(meta.NAME_TITLE
> ).setContent("Teapot.x3d").setDir("").setHttp_equiv("")/*
> xml:lang='' */.setScheme(""))
> + .addMeta(new meta().setName(meta.NAME_DESCRIPTION).setContent("A
> mooring buoy used in Naval Harbors").setDir("").setHttp_equiv("")/*
> xml:lang='' */.setScheme(""
> ))
> + .addMeta(new meta().setName(meta.NAME_CREATOR ).setContent("LT
> Patrick Sullivan").setDir("").setHttp_equiv("")/* xml:lang=''
> */.setScheme(""))
> + .addMeta(new meta().setName(meta.NAME_CREATED ).setContent("28
> July 2006").setDir("").setHttp_equiv("")/* xml:lang='' */.setScheme(""))
> + .addMeta(new meta().setName(meta.NAME_MODIFIED ).setContent("12
> January 2014").setDir("").setHttp_equiv("")/* xml:lang=''
> */.setScheme(""))
> + .addMeta(new meta().setName(meta.NAME_IDENTIFIER
> ).setContent("https://savage.nps.edu/Savage/HarborEquipment/Buoys/MooringBuoy.x3d"
> <https://savage.nps.edu/Savage/HarborEquipment/Buoys/MooringBuoy.x3d>).setDir("").setHttp_equiv(""
> )/* xml:lang='' */.setScheme(""))
> + .addMeta(new meta().setName(meta.NAME_GENERATOR
> ).setContent("VizX3D, http://www.vivaty.com/downloads/studio
> <https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vivaty.com%2Fdownloads%2Fstudio&data=04%7C01%7Cbrutzman%40nps.edu%7Cc0455ddce86c44084be808d9aa7e7456%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C637728282827020212%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=vvFFUsxQcVIn4PvmIskqNYoWii0HQ6mVy067mDLvj2c%3D&reserved=0>").setDir("").setHttp_equiv("")/*
> xml:lang='' */.se
> tScheme(""))
> + .addMeta(new meta().setName(meta.NAME_GENERATOR
> ).setContent("Wings3D, http://www.wings3d.com
> <https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.wings3d.com%2F&data=04%7C01%7Cbrutzman%40nps.edu%7Cc0455ddce86c44084be808d9aa7e7456%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C637728282827020212%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=q5xJEBPJD%2BW49vmy0d8%2B0spdSV77sOYAEzuP3E%2FQ2Q0%3D&reserved=0>").setDir("").setHttp_equiv("")/*
> xml:lang='' */.setScheme(""))
> + .addMeta(new meta().setName(meta.NAME_GENERATOR
> ).setContent("X3D-Edit,
> https://savage.nps.edu/X3D-Edit").setDir("").setHttp_equiv("")/*
> xml:lang='' */.setSche
> me(""))
> + .addMeta(new meta().setName(meta.NAME_LICENSE
> ).setContent("../../license.html").setDir("").setHttp_equiv("")/*
> xml:lang='' */.setScheme("")))
> .setScene(new Scene()
> .addChild(new Transform().setScale(0.3,0.3,0.3)
> .addChild(new Group("MooringBuoyWithHook")
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20211119/6cc536ba/attachment-0001.html>
More information about the x3d-public
mailing list