[x3d-public] I don't like the new X3dToJson.xslt stylesheet escaping
Don Brutzman
brutzman at nps.edu
Wed Mar 22 07:43:33 PDT 2017
John, let's get comfortable escaping and MFString before any further big code changes.
First, your example .x3d
<Text string='"Node\"\"\""'>
is proper X3D because it is strictly including a double-quoted SFString inside the MFString attribute value, and each displayable quote is escaped with a backslash.
A browser would be expected to render
Node"""
I think that your .json appears OK too.
"@string":["Node\\\"\\\"\\\""],
where, according to JSON syntax, each backslash is escaped with a backslash and each displayable quote is escaped with a backslash.
Similar effort needed with & characters, I can check your other example tonight.
On 3/21/2017 10:25 PM, yottzumm at gmail.com wrote:
> I don’t like the new X3dToJson.xslt stylesheet. I will have to change my rendering code to remove /. Which may all be for the best. I will have to change the X3DJSONLD to take out more \, not just in the JavaSerializer. This affects the DOM and Python Serializers as well. The best I can hope for is to create a DOM which makes the serializers easy (DOM serialization should be dead simple).
>
>
>
> See attached *.new.json files. Also *.x3d.new should agree with the Other .x3d files. I’m not sure they do.
>
>
>
> We will have to document the removal of the / in the code for the JSON standard for rendering.
>
>
>
> John
>
>
>
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
More information about the x3d-public
mailing list