[x3d-public] Can you make X3dToJson.xslt work with this file? multiple \"\"\"
yottzumm at gmail.com
Sat May 20 18:54:11 PDT 2017
Thanks bunches. Am eager to try, but still have my mind stuck on loading loads of subscenes eay for Clement, without having to specify Inlines. Trying to figure out how to do element.addEventQuerySelector() for all missing selected elements.
Sent from Mail for Windows 10
From: Don Brutzman
Sent: Saturday, May 20, 2017 9: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/20/2017 4:42 PM, John Carlson wrote:
> 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.
OK sounds good.
I restored the following block (more complete) from a prior version:
<!-- special characters backspace, formfeed, newline, carriage return, horizontal tab are presumably character entities already -->
<!-- page links for character entities http://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#HTML -->
<!-- http://www.w3schools.com/js/js_strings.asp -->
<xsl:when test="($nextCharAfterBackslash = '/') or
($nextCharAfterBackslash = 'n') or
($nextCharAfterBackslash = 'r') or
($nextCharAfterBackslash = 't') or
($nextCharAfterBackslash = 'b') or
($nextCharAfterBackslash = 'f')">
<xsl:if test="$debugTrace"><xsl:message><xsl:text>[e-b-c-r][23.5]</xsl:text><xsl:value-of select="$debugMessage"/></xsl:message></xsl:if>
<xsl:with-param name="inputString" select="$remainder"/>
Example conversion attached, looks like it handled literal \n characters in Script source OK.
" tracePrint (' keyValueOrientation[k+1]=' + keyValueOrientation[k+1].toString() + '\n');",
" Browser.print ('[CameraMovement] ' + outputString + '\n');",
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
> *From: *Don Brutzman <mailto:brutzman at nps.edu>
> *Sent: *Saturday, May 20, 2017 7:31 PM
> *To: *John Carlson <mailto:yottzumm at gmail.com>
> *Cc: *X3D Graphics public mailing list <mailto:x3d-public at web3d.org>; Roy Walmsley <mailto:roy.walmsley at ntlworld.com>
> *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 \"\"\" 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\"\"\""'>
> 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!"'>
> <Text DEF='TextMessage' string='"Hello" "" "world!"'>
> but not
> <Text DEF='TextMessage' string='"Hello""world!"'>
> <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
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...
More information about the x3d-public