[x3d-public] uRE: summary of remaining JSON parse errors
Roy Walmsley
roy.walmsley at ntlworld.com
Tue Mar 1 10:25:53 PST 2016
Hi,
In JSON you do not escape a single quote (apostrophe). However, you do escape a reverse solidus and you do escape a double quote.
So, if you have the XML string
'string [ \"proxy is\" \"any-order child\" \"of Collision\" ]' +
it needs to be understood as an XML string. Consider the corresponding UNICODE code points. One interesting illustrative sequence is as follows:
…
g U+0067
space U+0020
[ U+005b
space U+0020
\ U+005c
“ U+0022
p U+0070
…
Notice that the reverse solidus and the double quote are treated as separate characters. There is no escape sequence \” in XML.
So, how are these code points represented in a text string in JSON? There we do have escape sequences. U+005c is \\ and U+0022 is \”. So, the full text string becomes:
'string [ \\\"proxy is\\\" \\\"any-order child\\\" \\\"of Collision\\\" ]' +
Roy
From: John Carlson [mailto:yottzumm at gmail.com]
Sent: 01 March 2016 17:45
To: Don Brutzman
Cc: Roy Walmsley; X3D Graphics public mailing list
Subject: Re: summary of remaining JSON parse errors
Results.
examples//Basic/development/ProxyShapeExample.json
It looks like you’re \ escaping a \ in front of a “ (double quote) which is probably bad. This preamble in a string is bad because you’re not quoting the “: "\t\t 'string [ \\ <file:///\\%22proxy> "proxy is\\”
The double quote after the tab is bad. You should escape a \ in front of a single quote I think, to make it \\' <smb://'> , since \’ is bad. And you should escape standalone double quotes. \” should be left alone? I am not sure. Sorry for any confusion.
examples//Basic/development/SchemaTest.json
[Error: Parse error on line 71:
... at translation <mailto:... at translation%22:[10000.e-1,50,0.5> ":[10000.e-1,50,0.5],
-----------------------^
Expecting 'EOF', '}', ',', ']', got 'undefined’]
Remove decimal point.
These files still have issues with metadata:
examples//Savage/Robots/UnmannedAirVehicles/ScanEagle.json
[Error: Parse error on line 173:
... { "MetadataString":
-----------------------^
Expecting 'STRING', got '{']
examples//Savage/Robots/UnmannedAirVehicles/SeaScan.json
[Error: Parse error on line 144:
... { "MetadataString":
-----------------------^
Expecting 'STRING', got '{']
examples//Savage/Robots/UnmannedSurfaceVehicles/SeaFox.json
[Error: Parse error on line 173:
... { "MetadataString":
-----------------------^
Expecting 'STRING', got '{']
examples//Savage/Robots/UnmannedSurfaceVehicles/SeaFoxOriginal.json
[Error: Parse error on line 151:
... { "MetadataString":
-----------------------^
Expecting 'STRING', got '{']
examples//Savage/ShipsMilitary/FFG-7OliverHazardPerry-UnitedStates/OliverHazardPerryFFG.json
[Error: Parse error on line 215:
... { "MetadataString":
-----------------------^
Expecting 'STRING', got '{']
On Mar 1, 2016, at 10:06 AM, Don Brutzman <brutzman at nps.edu> wrote:
Last night's build went OK.
Found and amended code block (template output-reals) to insert missing 0 after decimal point, before scientific notation (e.g. 1.e2 converted to 1.0e2).
Marked ScriptSyntaxExample.x3d meta information as a test scene.
Many of your error cases in log file were test scenes or archived backups, not working scenes. I'll keep scrutinizing and pursuing problems in the list.
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.
all the best, Don
--
Don Brutzman Naval Postgraduate School, Code USW/Br brutzman at nps.edu
Watkins 270, MOVES Institute, Monterey CA 93943-5000 USA +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20160301/584887a1/attachment-0001.html>
More information about the x3d-public
mailing list