[x3d-public] X3dToJson.xslt -- cannot handle "\\" as SFString in MFString properly

John Carlson yottzumm at gmail.com
Wed May 24 22:36:28 PDT 2017


"\\" in an MFString in XML becomes "\\\\" in JSON see attached XML and JSON.  Should remain the same.

Is it time for JSONSerializer.js yet?  One thing I should work on.  Half done.  This declarative stuff seems like hard work compared to imperative.

John
Sent from Mail for Windows 10

From: John Carlson
Sent: Thursday, May 25, 2017 1:15 AM
To: X3D Graphics public mailing list
Subject: X3dToJson.xslt -- cannot handle "\\\\" as SFString in MFString

Attached example shows problem.  Improperly adds extra \\ and backslashes next SFString.

$ jsonlint ../data/text.json
Error: Parse error on line 82:
...":["Node2","\\\\\\" \"Node2"],
-----------------------^
Expecting 'EOF', '}', ':', ',', ']', got 'undefined'
    at Object.parseError (C:\Users\coderextreme\AppData\Roaming\nvm\v7.6.0\node_modules\jsonlint\lib\jsonlint.js:55:11)
    at Object.parse (C:\Users\coderextreme\AppData\Roaming\nvm\v7.6.0\node_modules\jsonlint\lib\jsonlint.js:132:22)
    at parse (C:\Users\coderextreme\AppData\Roaming\nvm\v7.6.0\node_modules\jsonlint\lib\cli.js:82:14)
    at main (C:\Users\coderextreme\AppData\Roaming\nvm\v7.6.0\node_modules\jsonlint\lib\cli.js:135:14)
    at Object.<anonymous> (C:\Users\coderextreme\AppData\Roaming\nvm\v7.6.0\node_modules\jsonlint\lib\cli.js:179:1)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)

John


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170525/98fb012a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: text.json
Type: application/json
Size: 4406 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170525/98fb012a/attachment.json>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: text.x3d
Type: application/octet-stream
Size: 2151 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170525/98fb012a/attachment.obj>


More information about the x3d-public mailing list