[x3d-public] Can you make X3dToJson.xslt work with this file? multiple \"\"\"

John Carlson yottzumm at gmail.com
Sat May 20 16:42:40 PDT 2017


Can you at least keep the \n handling?  I was hoping for that one I think.  That’s the nextChar code.  I can send again, if desired.

John

Sent from Mail for Windows 10

From: Don Brutzman
Sent: Saturday, May 20, 2017 7:31 PM
To: John Carlson
Cc: X3D Graphics public mailing list; Roy Walmsley
Subject: Re: Can you make X3dToJson.xslt work with this file? multiple \"\"\"

On 5/19/2017 1:37 PM, John Carlson wrote:
> Thanks.  Version of X3dToJson.xslt is attached.  I am thinking \"\"\&quot might be something to match.

Thanks for the stylesheet effort.  I kept the parts that strip html tags and x3dom's specialized <X3D> attributes, we can continue on that another day.

The other parts for MFString recurision I wasn't really able to use.  The existing logic is quite complex/subtle, adding another branch would have been very hard to debug/maintain.  Instead used the debugging traces and improved the existing logic.  This is especially tricky because first you have to get through escape-backslash-characters-recurse template before continuing with escape-quote-characters-recurse template.

Took some doing but I got your special example to work, apparently without breaking anything else.  X3D for Advanced Modeling passes, others are in progress.

for your text.x3d example:

	<Text string='"Node\"\"\""'>

becomes
	"@string":["Node\"\"\""],

as expected.

I then tried to handle adjacent SFString values in an MFString list without intervening whitespace.

can handle typical

	<Text DEF='TextMessage' string='"Hello" "world!"'>
or
	<Text DEF='TextMessage' string='"Hello" "" "world!"'>

but not
	<Text DEF='TextMessage' string='"Hello""world!"'>
or
	<Text DEF='TextMessage' string='"Hello""""world!"'>

need to think about context-free parsing a bit more.  not yet sure how to get there from here.  that special case will require more work, perhaps another day.

X3dToJson.xslt changes checked in, will update json .zip tonight.

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/20170520/0643154f/attachment-0001.html>


More information about the x3d-public mailing list