[x3d-public] x3djsail. Fix to stylesheet which generates X3DJSAIL

yottzumm at gmail.com yottzumm at gmail.com
Tue Mar 21 22:07:38 PDT 2017


You needed to do replaceAll on the entities, I think.  See below.


$ svn diff
Index: CreateX3dSceneAccessInterfaceJava.xslt
===================================================================
--- CreateX3dSceneAccessInterfaceJava.xslt      (revision 24422)
+++ CreateX3dSceneAccessInterfaceJava.xslt      (working copy)
@@ -12771,7 +12771,7 @@
                <xsl:when test="(@type='MFString')">
                        <xsl:text>
                return (new MFString</xsl:text><xsl:value-of select="$jsaiClassSuffix"/>
-                       <xsl:text>(value)).toString().replace("\",\"","\" \""); // removes intermediate commas between quotes</xsl:text>
+                       <xsl:text>(value)).toString().replaceAll("\",\"","\" \""); // removes intermediate commas between quotes</xsl:text>
                </xsl:when>
                <xsl:when test="(@type='MFFloat') or (@type='MFDouble') or (@type='MFTime') or (@type='SFRotation') or (@type='MFRotation') or
                                                 contains(@type, 'Color') or contains(@type,'Vec') or contains(@type,'Matrix')">
@@ -12813,11 +12813,11 @@
        public static String toStringX3D (String value)
        {
                return (new SFStringObject(value)).toString()
-                               .replace("&","&")           // escape ampersands
-                               .replace("<","<")            // escape    less-than < signs
-                               .replace(">",">")            // escape greater-than > signs in XML attributes
-                               .replace("'","'")          // escape apostrophes since XML attributes in this output are delimited by apostrophes
-                               .replace("\"","\\"");      // escape embedded quotation marks
+                               .replaceAll("&","&")                // escape ampersands
+                               .replaceAll("<","<")         // escape    less-than < signs
+                               .replaceAll(">",">")         // escape greater-than > signs in XML attributes
+                               .replaceAll("'","'")               // escape apostrophes since XML attributes in this output are delimited by apostrophes
+                               .replaceAll("\"","\\"");   // escape embedded quotation marks
        }

        /**
@@ -12854,10 +12854,10 @@
                                result.append("\"");
                        // avoid SFStringObject.toStringX3D(MFString[i]) due to additional contrary handling of \" and &
                        String escapedValue = MFString[i]
-       //                      .replace("&","&")           // escape ampersands
-                               .replace("<","<")            // escape    less-than < signs
-                               .replace(">",">")            // escape greater-than > signs in XML attributes
-                               .replace("'","'");         // escape apostrophes since XML attributes in this output are delimited by apostrophes
+       //                      .replaceAll("&","&")                // escape ampersands
+                               .replaceAll("<","<")         // escape    less-than < signs
+                               .replaceAll(">",">")         // escape greater-than > signs in XML attributes
+                               .replaceAll("'","'");              // escape apostrophes since XML attributes in this output are delimited by apostrophes
                        result.append(escapedValue);    // apply escaping to each SFString value
                        if (!MFString[i].startsWith("\""))
                                result.append("\"");
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170322/efdd1df4/attachment-0001.html>


More information about the x3d-public mailing list