<div dir="ltr">Code in question in X3dToPython.xslt, I think, for MFBool's.<div><br></div><div>            <xsl:when test="($x3dType = 'MFBool')"><br>                <!-- Python boolean values are True and False, comma-separated list --><br>                <xsl:value-of select="translate(translate(translate(string($x3dValue),'f','F'),'t','T'),' ',',')"/><br>            </xsl:when><br></div><div><br></div><div>Spaces are translated to ',', i think, to "true, false" in XML gets translated to "True,,False" in Python.</div><div><br></div><div>I don't know how to fix this yet (I'm an XSLT plebe), except fix the XML so Python will work okay.  Maybe we should put a feature request into Saxon or ask for help?</div><div><br></div><div>At this point, my suggestion would be to fall back to some kind of regular expression replacement?</div><div><br></div><div>Or what I would do in sed, like:</div><div><br></div><div>s/,+/,/g</div><div><br></div><div>and</div><div><br></div><div>s/ +/ /g</div><div><br></div><div>between SFBools</div><div><br></div><div>One may wish to put \s or \S , from more advanced regular expressions, and only allow one comma between SFBools in the MFBool.</div><div><br></div><div>I don't know if XSLT supports any of this.  Check out this table for XSLT 2.0?  Is this accurate?</div><div><br></div><div><a href="https://flylib.com/books/en/2.424.1.122/1/">16.4 Using Regular Expressions | Learning XSLT (flylib.com)</a></div><div><br></div><div>Did a little googling, found this:</div><div><br></div><div><a href="https://stackoverflow.com/questions/35840063/xslt-regular-expression-replace">regex - XSLT + regular expression replace - Stack Overflow</a> (analyze-string)<br></div><div><br></div><div>Perhaps a few of us could attend an advanced XSLT course?</div><div><br></div><div>Maybe we could have a learning session?  I only see one analyze-string in our XSLT code base.</div><div><br></div><div>Could be a big win, would be my guess.</div><div><br></div><div>Or we could use SNOBOL or its derivative, Icon. <a href="https://en.wikipedia.org/wiki/Icon_%28programming_language%29">Icon (programming language) - Wikipedia</a> (see "Dialects" and "Influenced" for additional features, some 3D).</div><div><br>I studied Icon in school, and it was a good language, I didn't run into any snafu's with our problem set solutions.</div><div><br></div><div>I would recommend Icon over XML, XSLT, Python and JavaScript, if anyone cares, at least for text processing.  I didn't do 3D with Icon.</div><div><br></div><div>John</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 4, 2022 at 8:18 PM John Carlson <<a href="mailto:yottzumm@gmail.com">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Trying to help...For MFBool in X3d tooltips, perhaps rephrase whitespace as below, for both XML, JSON and Python (and perhaps others).<div><br></div><div><b style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium;background-color:rgb(153,204,204)"><font color="#447777">Hint:</font></b><span style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium;background-color:rgb(153,204,204)"> a single comma character is allowed as whitespace between individual SFBool values in the list.</span><br></div><div><span style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium;background-color:rgb(255,255,255)"><br></span></div><div><font color="#000000" face="Times New Roman" size="3" style="background-color:rgb(255,255,255)">Sorry, I apologize for bringing up MFStrings.  I was in the wrong.</font></div><div><span style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium;background-color:rgb(153,204,204)"><br></span></div><div><span style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium;background-color:rgb(153,204,204)"><br></span></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 4, 2022 at 7:53 PM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">If commas are not allowed in XML for MFBool, then Holger needs to change her particle system code.<div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 4, 2022 at 7:49 PM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Note: Please clarify MFBool. I will look again at recent emails.</div><div><br></div><div>My understanding is that SFBool values can be separated by /, / comma followed by space in an MFBool in XML (comma as whitespace). What I'm not understanding is the Python output from X3dToPython.xslt, which puts out commas next to each other (comma not as whitespace).  See below.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 4, 2022 at 4:56 PM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Note extra commas in MFBool outputs from X3dToPython.xslt and X3dToJson.xslt.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 4, 2022 at 4:23 PM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Note, the following examples are unvalidated. Beware!<div><br></div><div>For example, from: 

<a href="https://raw.githubusercontent.com/create3000/Library/main/Tests/Components/ParticleSystems/BoundedPhysicsModel.x3d" target="_blank">https://raw.githubusercontent.com/create3000/Library/main/Tests/Components/ParticleSystems/BoundedPhysicsModel.x3d</a><div>    <BooleanSequencer DEF='_4'<br>        key='0, 0.3, 1'<br>        keyValue='true, false'/></div><div><br></div></div><div>And python:</div><div><br></div><div>BooleanSequencer(DEF='_4',key=[0,0.3,1],keyValue=[True,,False]),</div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
</blockquote></div>
</blockquote></div></div>
</blockquote></div></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>