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

Don Brutzman brutzman at nps.edu
Wed Mar 22 17:25:42 PDT 2017


fixed and deployed, thanks

On 3/21/2017 10:07 PM, yottzumm at gmail.com wrote:
> 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("\"");
>


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