[x3d-public] summary of remaining JSON parse errors
John Carlson
yottzumm at gmail.com
Mon Feb 29 09:03:43 PST 2016
Since JSON strings use “”, I don’t think you need to escape ' single quote. That’s the error? But if you want to produced a \, you’ll need to escape it with \\. see http://json.org
John
> On Feb 29, 2016, at 10:02 AM, Don Brutzman <brutzman at nps.edu> wrote:
>
> cc: list
>
> Thanks for the summary and details, very helpful. We are indeed getting closer.
>
> This weekend I was able to clear up all of the warnings being reported by the X3dToJson.xslt stylesheet. Updated output:
> http://www.web3d.org/x3d/content/examples/build.json.out
>
> Looking at these next.
>
> On 2/26/2016 2:18 PM, John Carlson wrote:
>> Some number formatting issues (need digit after .)
>> Escaping issues
>> ContainerField naming or object attribute value braces missing.
>> ‘,’ value is missing.
>> Bad source documents (not X3D).
>> -metadata should be an array or a containerField.
>>
>> Annotated error report attached (with line numbers).
>
> First one I'm not so sure about. It appears happy with the construct \' in source, not clear how we should escape that. Possibly \\ for \ character?
>
> Source follows. We need to think at the X3D level as well. The \' is intended to output the apostrophe character in the X3D Javascript console, the ' characters are Javascript string delimiters.
>
> X3D
> if (!animated) // output results
> {
> tracePrint ('<PositionInterpolator DEF=\'CameraPositionInterpolator\' key=\'' + stripBrackets(CameraPI.key) + '\' keyValue=\'' + stripBrackets(CameraPI.keyValue) + '\'/>');
> tracePrint ('<OrientationInterpolator DEF=\'CameraOrientationInterpolator\' key=\'' + stripBrackets(CameraOI.key) + '\' keyValue=\'' + stripBrackets(CameraOI.keyValue) + '\'/>');
> }
>
> JSON
> " tracePrint ('<PositionInterpolator DEF=\'CameraPositionInterpolator\' key=\'' + stripBrackets(CameraPI.key) + '\' keyValue=\'' + stripBrackets(CameraPI.keyValue) + '\'/>');",
>
> If you want to test also, the scene animates OK under InstantReality and BS Contact. Conversion log:
>
> C:\x3d-code\www.web3d.org\x3d\content\examples\Basic/development//CameraPrototypes.x3d processing with X3dToJson stylesheet
> Script DEF=CameraScript contains CDATA source-code text, copied as "#sourceText" using "strings" mode
> Script DEF=CameraShotScript contains CDATA source-code text, copied as "#sourceText" using "strings" mode
> Script DEF=CameraMovementScript contains CDATA source-code text, copied as "#sourceText" using "strings" mode
> Script DEF=OfflineRenderScript contains CDATA source-code text, copied as "#sourceText" using "strings" mode
> C:\x3d-code\www.web3d.org\x3d\content\examples\Basic/development//CameraPrototypes.json processing with jslint
> jslint:C:\x3d-code\www.web3d.org\x3d\content\examples\Basic/development//CameraPrototypes.json:718:1:JavaScript URL.
> jslint:C:\x3d-code\www.web3d.org\x3d\content\examples\Basic/development//CameraPrototypes.json:867:53:Unexpected '\''.
> jslint:C:\x3d-code\www.web3d.org\x3d\content\examples\Basic/development//CameraPrototypes.json:867:81:Unexpected '\''.
> jslint:C:\x3d-code\www.web3d.org\x3d\content\examples\Basic/development//CameraPrototypes.json:867:91:Unexpected '\''.
> [... etc. for all occurrences ...]
>
>> And the 1280 GeoOrigin USE before DEF ones.
>
> Those scenes are all fixed and checked in, server uploads later today.
>
> John, any scenes in subdirectories like "_archive" or "save" are working drafts and do not need to pass testing. Similarly those found in Java source subdirectories. OK to look at them I guess but not expected to be workable at this point.
>
> all the best, Don
> --
> Don Brutzman Naval Postgraduate School, Code USW/Br brutzman at nps.edu
> Watkins 270, MOVES Institute, Monterey CA 93943-5000 USA +1.831.656.2149
> X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman
> <nonlocations.txt><nonlocationerrorreport.txt>
More information about the x3d-public
mailing list