[x3d-public] [not SOLVED] Re: [x3d:tickets] #10 JSON schema errors that start to make sense. Need X3dToJson.xslt updates to create MFString arrays.

John Carlson yottzumm at gmail.com
Tue Jan 18 07:47:26 PST 2022


But the new (old?) stylesheets I used do not contain #sourceCode arrays
yet.  Waiting for a release now which includes both.

John


On Tue, Jan 18, 2022 at 8:22 AM John Carlson <yottzumm at gmail.com> wrote:

> Sorry, Third message in attempt. Here's how I think I'm currently running
> the stylesheet (in X3DJSONLD/src/main/shell/several.sh)
>
> java net.coderextreme.RunSaxon --- ---overwrite
> --${STYLESHEETDIR}/X3dToJson.xslt -json
>
> followed by X3D XML files.
>
> Here's a concrete example:
>
> X3DJSONLD/src/main $ java -cp "java;../../saxon-he-10.6.jar"
> net.coderextreme.RunSaxon --- ---overwrite --/x3d-code/
> www.web3d.org/x3d/stylesheets/X3dToJson.xslt -json
> data/HelloWorldProgramOutput.x3d
> BEGIN data/HelloWorldProgramOutput.x3d > json, Script
> DEF=colorTypeConversionScript contains CDATA source-code text, copied as
> "#sourceCode" using "strings" mode
> Script DEF=MaterialModulatorScript contains CDATA source-code text, copied
> as "#sourceCode" using "strings" mode
> Script DEF=colorTypeConversionScript contains CDATA source-code text,
> copied as "#sourceCode" using "strings" mode
> Script DEF=MaterialModulatorScript contains CDATA source-code text, copied
> as "#sourceCode" using "strings" mode
> END data/HelloWorldProgramOutput.x3d
> data/HelloWorldProgramOutput.json
>
> I will try another stylesheet processor, hang on.  Here it is.   Attaching
> xslt output to this email as a txt.   Basically, the output file is very
> corrupted. As you can see from the below log.   Please fix if possible.
>
> $ ../../../node_modules/.bin/xslt3 -xsl:/c/x3d-code/
> www.web3d.org/x3d/stylesheets/X3dToJson.xslt
> -s:../data/HelloWorldProgramOutput.x3d -o:foo.txt
> Script DEF=MaterialModulatorScript contains CDATA source-code text, copied
> as "#sourceCode" using "strings" mode
> Error: IllegalChildNodeFieldNameNotFound no containerField or field name
> found for the X3D JSON object. Check spelling of node.
>   $elementName=Viewpoint, DEF=DefaultView, $parentName=ViewpointGroup
>   Please report this error to x3d-public at web3d.org - thanks for your help
> improving X3D Quality Assurance (QA).
> Error: IllegalChildNodeFieldNameNotFound no containerField or field name
> found for the X3D JSON object. Check spelling of node.
>   $elementName=Viewpoint, DEF=TopDownView, $parentName=ViewpointGroup
>   Please report this error to x3d-public at web3d.org - thanks for your help
> improving X3D Quality Assurance (QA).
> Script DEF=MaterialModulatorScript contains CDATA source-code text, copied
> as "#sourceCode" using "strings" mode
> Script DEF=MaterialModulatorScript contains CDATA source-code text, copied
> as "#sourceCode" using "strings" mode
> Script DEF=MaterialModulatorScript contains CDATA source-code text, copied
> as "#sourceCode" using "strings" mode
> Script DEF=MaterialModulatorScript contains CDATA source-code text, copied
> as "#sourceCode" using "strings" mode
> Script DEF=MaterialModulatorScript contains CDATA source-code text, copied
> as "#sourceCode" using "strings" mode
> Script DEF=MaterialModulatorScript contains CDATA source-code text, copied
> as "#sourceCode" using "strings" mode
> Error: IllegalChildNodeFieldNameNotFound no containerField or field name
> found for the X3D JSON object. Check spelling of node.
>   $elementName=Anchor, DEF=siteAnchor, $parentName=Transform
>   Please report this error to x3d-public at web3d.org - thanks for your help
> improving X3D Quality Assurance (QA).
> Error: IllegalChildNodeFieldNameNotFound no containerField or field name
> found for the X3D JSON object. Check spelling of node.
>   $elementName=Shape, DEF=BoxShape, $parentName=Anchor
>   Please report this error to x3d-public at web3d.org - thanks for your help
> improving X3D Quality Assurance (QA).
> Error: IllegalChildNodeFieldNameNotFound no containerField or field name
> found for the X3D JSON object. Check spelling of node.
>   $elementName=Appearance, $parentName=Shape
>   Please report this error to x3d-public at web3d.org - thanks for your help
> improving X3D Quality Assurance (QA).
> Error: IllegalChildNodeFieldNameNotFound no containerField or field name
> found for the X3D JSON object. Check spelling of node.
>   $elementName=Material, DEF=GreenMaterial, $parentName=Appearance
>   Please report this error to x3d-public at web3d.org - thanks for your help
> improving X3D Quality Assurance (QA).
> Error: IllegalChildNodeFieldNameNotFound no containerField or field name
> found for the X3D JSON object. Check spelling of node.
>   $elementName=ImageTexture, $parentName=Appearance
>   Please report this error to x3d-public at web3d.org - thanks for your help
> improving X3D Quality Assurance (QA).
> Error: IllegalChildNodeFieldNameNotFound no containerField or field name
> found for the X3D JSON object. Check spelling of node.
>   $elementName=Box, DEF=test-NMTOKEN_regex.0123456789, $parentName=Shape
>   Please report this error to x3d-public at web3d.org - thanks for your help
> improving X3D Quality Assurance (QA).
> Script DEF=MaterialModulatorScript contains CDATA source-code text, copied
> as "#sourceCode" using "strings" mode
> Error: IllegalChildNodeFieldNameNotFound no containerField or field name
> found for the X3D JSON object. Check spelling of node.
>   $elementName=Appearance, $parentName=Shape
>   Please report this error to x3d-public at web3d.org - thanks for your help
> improving X3D Quality Assurance (QA).
> Error: IllegalChildNodeFieldNameNotFound no containerField or field name
> found for the X3D JSON object. Check spelling of node.
>   $elementName=Material, $parentName=Appearance
>   Please report this error to x3d-public at web3d.org - thanks for your help
> improving X3D Quality Assurance (QA).
> Error: IllegalChildNodeFieldNameNotFound no containerField or field name
> found for the X3D JSON object. Check spelling of node.
>   $elementName=IndexedLineSet, $parentName=Shape
>   Please report this error to x3d-public at web3d.org - thanks for your help
> improving X3D Quality Assurance (QA).
> Error: IllegalChildNodeFieldNameNotFound no containerField or field name
> found for the X3D JSON object. Check spelling of node.
>   $elementName=Coordinate, $parentName=IndexedLineSet
>   Please report this error to x3d-public at web3d.org - thanks for your help
> improving X3D Quality Assurance (QA).
> Script DEF=MaterialModulatorScript contains CDATA source-code text, copied
> as "#sourceCode" using "strings" mode
> Script DEF=MaterialModulatorScript contains CDATA source-code text, copied
> as "#sourceCode" using "strings" mode
> Script DEF=MaterialModulatorScript contains CDATA source-code text, copied
> as "#sourceCode" using "strings" mode
> Script DEF=MaterialModulatorScript contains CDATA source-code text, copied
> as "#sourceCode" using "strings" mode
>
>
> So I'm not seeing that a correct NavigationInfo.type field as a JSON array
> is being produced. The type field is a JSON string.
>
> I am not sure why my results are different. My best guess is that a
> version of X3dToJson.xslt did not get checked in.
>
> The next step is to compare X3dToJson.xslt. Got it, I think. There are
> significant difference between these two files:
>
> $ diff /c/x3d-code/www.web3d.org/x3d/stylesheets/X3dToJson.xslt
> /c/x3d-code/
> www.web3d.org/x3d/stylesheets/java/lib/stylesheets/X3dToJson.xslt
> [snip, run on your system[
>
> Indeed, there are many differences:
>
> $ diff /c/x3d-code/www.web3d.org/x3d/stylesheets/ /c/x3d-code/
> www.web3d.org/x3d/stylesheets/java/lib/stylesheets/|grep
> <http://www.web3d.org/x3d/stylesheets/java/lib/stylesheets/%7Cgrep> ^diff
> diff /c/x3d-code/www.web3d.org/x3d/stylesheets/X3dTidy.xslt /c/x3d-code/
> www.web3d.org/x3d/stylesheets/java/lib/stylesheets/X3dTidy.xslt
> diff /c/x3d-code/www.web3d.org/x3d/stylesheets/X3dToES5.xslt /c/x3d-code/
> www.web3d.org/x3d/stylesheets/java/lib/stylesheets/X3dToES5.xslt
> diff /c/x3d-code/www.web3d.org/x3d/stylesheets/X3dToHtml.xslt /c/x3d-code/
> www.web3d.org/x3d/stylesheets/java/lib/stylesheets/X3dToHtml.xslt
> diff /c/x3d-code/www.web3d.org/x3d/stylesheets/X3dToJava.xslt /c/x3d-code/
> www.web3d.org/x3d/stylesheets/java/lib/stylesheets/X3dToJava.xslt
> diff /c/x3d-code/www.web3d.org/x3d/stylesheets/X3dToJson.xslt /c/x3d-code/
> www.web3d.org/x3d/stylesheets/java/lib/stylesheets/X3dToJson.xslt
> diff /c/x3d-code/www.web3d.org/x3d/stylesheets/X3dToNodeJS.xslt
> /c/x3d-code/
> www.web3d.org/x3d/stylesheets/java/lib/stylesheets/X3dToNodeJS.xslt
> diff /c/x3d-code/www.web3d.org/x3d/stylesheets/X3dToPython.xslt
> /c/x3d-code/
> www.web3d.org/x3d/stylesheets/java/lib/stylesheets/X3dToPython.xslt
> diff /c/x3d-code/www.web3d.org/x3d/stylesheets/X3dToVrml97.xslt
> /c/x3d-code/
> www.web3d.org/x3d/stylesheets/java/lib/stylesheets/X3dToVrml97.xslt
> diff /c/x3d-code/www.web3d.org/x3d/stylesheets/X3dToX3dom.xslt
> /c/x3d-code/
> www.web3d.org/x3d/stylesheets/java/lib/stylesheets/X3dToX3dom.xslt
> diff /c/x3d-code/www.web3d.org/x3d/stylesheets/X3dToXhtml.xslt
> /c/x3d-code/
> www.web3d.org/x3d/stylesheets/java/lib/stylesheets/X3dToXhtml.xslt
>
> Copying the lib/stylesheets to a local X3DJSONLD file fixed the problem!
>
> John
>
> On Tue, Jan 18, 2022 at 7:36 AM John Carlson <yottzumm at gmail.com> wrote:
>
>> Sorry for two messages. I don't know what's happening either. Is
>> SourceForge up-to-date with X3dToJson.xslt?  This is a very long standing
>> issue for me.
>>
>> I think we're all onboard with NavigationInfo.type being  a JSON array
>> and not a JSON string? I am trying to pursue why I am getting a JSON string
>> from X3dToJson.xslt.  But recently builds of x3d/stylesheets/java/examples
>> on my system have shown that that tree may have issues too, not just
>> X3DJSONLD.
>>
>> Here is a nearly current NavigationInfo from a very recently generated
>> file (ball.json in X3DJSONLD).  I still may need update X3dToJson.xslt at
>> this point.  I will attempt to do that. Done.
>>
>>           { "NavigationInfo":
>>             {
>>               "@type":"\"ANY\" \"EXAMINE\" \"FLY\" \"LOOKAT\""
>>             }
>>           },
>>
>> I think the problem may have been that I had an X3dToJson.sef.json file.
>> That is not it, AFAIK.  I removed that file
>>
>> We have nearly identical X3dToJson.xslt files as far as I can tell. Here
>> are the differences:
>> $ diff !:2 !:3
>> diff ../lib/stylesheets/X3dToJson.xslt /c/x3d-code/
>> www.web3d.org/x3d/stylesheets/X3dToJson.xslt
>> 3c3
>> < Copyright (c) 2001-2021 held by the author(s).  All rights reserved.
>> ---
>> > Copyright (c) 2001-2022 held by the author(s).  All rights reserved.
>>
>> This appears to be something we can work from:
>>
>>
>> https://www.web3d.org/x3d/content/examples/ConformanceNist/BindableNodes/NavigationInfo/jumpcut_loadurl.json
>>
>> This file shows NavigationInfo.type and url fields as correct in my mind.
>>
>> So there's an issue on my system somewhere perhaps--AFAIK, my system is a
>> fresh install.   Please show a recent JSON conversion output (web version
>> is okay, but NavigationInfo.type from the recently created JSON file would
>> be great).
>>
>> Please check on your system:
>>
>> x3d/stylesheets/java/examples/HelloWorldProgramOutput.json
>>
>>           { "NavigationInfo":
>>             {
>>               "@type":"\"EXAMINE\" \"FLY\" \"ANY\""
>>             }
>>           },
>>
>> Is what I see.  A JSON string.  Hmmm
>>
>> Could it be we have a different stylesheet inside the X3DJSAIL jar?  I
>> use my own Java stylesheet processor (Saxon-based).
>>
>> Thanks for your time pursuing this.  For me, the online version is
>> correct. and the HelloWorld version is incorrect.  I will try to regenerate
>> the HelloWorld  version now
>>
>> /x3d/stylesheets/java
>> $ ant all
>> Buildfile: C:\x3d-code\www.web3d.org\x3d\stylesheets\java\build.xml
>>
>> compile.examples:
>>      [echo] $java.examples.dir=C:\x3d-code\www.web3d.org
>> \x3d\stylesheets\java\examples
>>      [echo] compile.examples complete
>>
>> run.examples:
>>      [java] Exception in thread "main" java.lang.NoClassDefFoundError:
>> net/sf/saxon/s9api/SaxonApiException
>>      [java]     at HelloWorldProgram.<clinit>(HelloWorldProgram.java:64)
>>      [java] Caused by: java.lang.ClassNotFoundException:
>> *net.sf.saxon.s9api.SaxonApiException*
>>      [java]     at
>> java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
>>      [java]     at
>> java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
>>      [java]     at
>> java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
>>      [java]     ... 1 more
>>      [java] Java Result: 1
>>      [echo] run.examples complete
>>
>> all:
>>
>> BUILD SUCCESSFUL
>> Total time: 0 seconds
>>
>>
>> Tortoise SVN:
>>
>> Command: Update
>> Updating: C:\x3d-code\www.web3d.org from svn://
>> svn.code.sf.net/p/x3d/code/www.web3d.org
>> Completed: At revision: 32884
>>
>> I am a bit lost without command line svn diff,  I have reverted
>> everything with TortoiseSVN in www.web3d.org sourceforge copy
>>
>> -rw-r--r-- 1 john 197609  94346 Jan 18 07:13 HelloWorldProgramOutput.json
>>
>> I'm pretty much puzzled as you at this point.  After reverting, I will
>> diff the stylesheets again.  Essentially the same diff.
>>
>> So I'm guessing it may have something to do with the X3DJSAIL jar?
>> Please generate the HelloWorldProgramOutput.json and see what you get for
>> NavigationInfo.
>>
>> Thank you for all your time spent on this.  We need some kind of Hail
>> Mary at this point.  Maybe I'll wake up with a fresh idea.
>>
>> I think the first step may be to get Don's  X3DJSAIL
>> java/examples/HelloWorldProgramOutput.json passing XMLSpy validation.
>>
>> John
>>
>> On Tue, Jan 18, 2022 at 6:28 AM John Carlson <yottzumm at gmail.com> wrote:
>>
>>> Check any current X3D JSON file with NavigationInfo.type against a
>>> current X3D JSON Schema.   Send the NavigationInfo section of the X3D JSON
>>> file to me, so we can coordinate.  Please send a snapshot of XMLSpy
>>> validation success on the X3D  JSON file.
>>>
>>> I apologize for missing the meeting.
>>>
>>> I have read the pages you posted and the working draft.  I even read the
>>> below inclusion.
>>>
>>> Why are two different  MFStrings (URLs and NavigationInfo.type) handled
>>> differently?  Please show me an example of a different  MFString field
>>> encoded in JSON.
>>>
>>> Let’s get very concrete in this discussion, thanks.   There may be a big
>>> aha after we look at things concretely.
>>>
>>> Thanks!
>>>
>>>
>>> John
>>>
>>>
>>> On Mon, Jan 17, 2022 at 11:37 PM Brutzman, Donald (Don) (CIV) <
>>> brutzman at nps.edu> wrote:
>>>
>>>> Hi John.  What is happening?
>>>>
>>>>
>>>>
>>>> Regarding proposed handing of X3D MFString in JSON:  I’ve let you know
>>>> in email, telephone call and issue tracker that JSON MFString is documented
>>>> on the following page, which we produced together.  There are also
>>>> thousands of X3D Examples online that each include JSON encoding.
>>>>
>>>>
>>>>
>>>>    - X3D to JSON Stylesheet Converter
>>>>    - https://www.web3d.org/x3d/stylesheets/X3dToJson.html
>>>>
>>>>
>>>>
>>>> If you scroll down that page to JSON strings, you will find an
>>>> unambiguous JSON-produced railroad-track diagram and following table
>>>> entry.  Seems simple.
>>>>
>>>>
>>>>
>>>>    - https://www.web3d.org/x3d/stylesheets/X3dToJson.html#strings
>>>>
>>>>
>>>>
>>>> *X3D scene graph*
>>>>
>>>> *JSON representation*
>>>>
>>>> SFString is unquoted XML attribute value
>>>>
>>>> JSON value of *string* type. Backslash *\* (reverse solidus)
>>>> characters get escaped with an adjacent backslash *\* character,
>>>> resulting in *\\* value.
>>>> Similarly " (quotation mark) characters get escaped with an adjacent
>>>> backslash as *\"* value.
>>>>
>>>> MFString is array of quoted SFString (XML attribute) values
>>>>
>>>> JSON array of *string* type
>>>>
>>>>
>>>>
>>>> Are you now OK with what is stated and demonstrated regarding X3D
>>>> MFString as JSON arrays of string type?
>>>>
>>>>
>>>>
>>>> Meanwhile it is not clear from the issue whether the entry is about
>>>> JSON schema, X3dToJSON.xslt, MFString, JSON string, JSON string arrays, or
>>>> what.  Apologies but I’m not tracking your concern.
>>>>
>>>>
>>>>
>>>> You cite working draft (ISO-IEC19776-5, WD) but that document is in
>>>> private Web3D github, unreviewed by working group, and not public.  Our
>>>> group is not ready to review that yet.
>>>>
>>>>
>>>>
>>>>    - https://www.web3d.org/standards
>>>>
>>>>
>>>>
>>>> Have tried reading tracker issue #10 a few times but am still not sure
>>>> what the issue is asking.  Now you are cross-threading the sourceforge
>>>> issue tracker and the x3d-public mailing list...  ouch.  Color me “lost” on
>>>> this one.
>>>>
>>>>
>>>>
>>>> You might be thinking about the use of an XML attribute without extra
>>>> quotation marks, such as <Text string=’hey now’/> which is common.  The
>>>> Java and Python APIs are forgiving of such type mismatches, most of our
>>>> XML-handling tools are, ClassicVRML is forgiving, it will no doubt be
>>>> explicit in each of next spec versions.
>>>>
>>>>
>>>>
>>>> Please let’s dial it back and get focused.
>>>>
>>>>    - An issue tracker is good for simple fixable issues: point out
>>>>    specific problem, give a repeatable example.  If possible note reference
>>>>    and suggested solution.
>>>>    - Mailing lists are good for announcements and general discussion.
>>>>
>>>>
>>>>
>>>> A favorite quote: “Brevity is the soul of wit” – *Hamlet*, William
>>>> Shakespeare.
>>>>
>>>>
>>>>
>>>> Your efforts are appreciated but, in the midst of hugely tremendous X3D
>>>> detail, we must be precise and focused.  Hope this helps.
>>>>
>>>>
>>>>
>>>> Have Fun with X3D!  Or Else!   8)
>>>>
>>>>
>>>>
>>>> all the best, Don
>>>>
>>>> --
>>>>
>>>> Don Brutzman  Naval Postgraduate School, Code USW/Br
>>>> brutzman at nps.edu
>>>>
>>>> Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA
>>>> +1.831.656.2149
>>>>
>>>> X3D graphics, virtual worlds, Navy robotics https://
>>>> faculty.nps.edu/brutzman
>>>>
>>>>
>>>>
>>>> *From:* x3d-public <x3d-public-bounces at web3d.org> *On Behalf Of *
>>>> vmarchetti at kshell.com
>>>> *Sent:* Sunday, January 16, 2022 4:19 PM
>>>> *To:* John Carlson <yottzumm at gmail.com>
>>>> *Cc:* X3D-Public <x3d-public at web3d.org>
>>>> *Subject:* Re: [x3d-public] [x3d:tickets] #10 JSON schema errors that
>>>> start to make sense. Need X3dToJson.xslt updates to create MFString arrays.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Jan 16, 2022, at 4:30 PM, John Carlson <yottzumm at gmail.com> wrote:
>>>>
>>>>
>>>>
>>>> *[tickets:#10]
>>>> <https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsourceforge.net%2Fp%2Fx3d%2Ftickets%2F10%2F&data=04%7C01%7Cbrutzman%40nps.edu%7C056d678e0d2747cead9108d9d94f126b%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C637779756351904802%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=s5CLp5otd5aZaJFMlezFeZ3aZ0sxxCQHGhN%2BmLqNvOE%3D&reserved=0>
>>>> JSON schema errors that start to make sense. Need X3dToJson.xslt updates to
>>>> create MFString arrays.*
>>>>
>>>> *Discussion leading towards enlightenment whether MFStrings should be
>>>> arrays or strings in JSON (or both?).*
>>>>
>>>> Vince, I added you here because I thought you would want to advocate
>>>> for a single string MFString being a string and not an arrray.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> John
>>>>
>>>>
>>>>
>>>> Thank you for including me, but I would actually advocate for the
>>>> opposite, that any value typed as MFString be encoded as an MFString of 0,
>>>> 1, or N>1 elements, by whatever syntax is appropriate for that encoding.
>>>>
>>>>
>>>>
>>>> Vince
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> John
>>>>
>>>>
>>>>
>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20220118/efca5501/attachment-0001.html>


More information about the x3d-public mailing list