server/executionhandlers/ruby/dsl_to_dslx.xsl in cpee-2.1.70 vs server/executionhandlers/ruby/dsl_to_dslx.xsl in cpee-2.1.71
- old
+ new
@@ -629,18 +629,18 @@
</xsl:when>
<xsl:when test="child::node()[not(self::text())]">
<!-- FUUUU, there is probably much more TODO. Updated Matthias und Juergen, we tested for ing-opcua/execute -->
<xsl:choose>
<xsl:when test="child::* and name(child::*)=concat(name(.),'_item') and count(child::*[not(name()=name(../child::*[1]))])=0">
- <xsl:text>"[ </xsl:text>
+ <xsl:text>[ </xsl:text>
<xsl:apply-templates select="*" mode="JSONArrayItem"/>
- <xsl:text>]"</xsl:text>
+ <xsl:text>]</xsl:text>
</xsl:when>
<xsl:otherwise>
- <xsl:text>"{ </xsl:text>
+ <xsl:text>{ </xsl:text>
<xsl:apply-templates select="*" mode="JSONSUB"/>
- <xsl:text>}"</xsl:text>
+ <xsl:text>}</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
@@ -757,13 +757,13 @@
<xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="*" mode="JSONSUB">
- <xsl:text>\"</xsl:text>
+ <xsl:text>"</xsl:text>
<xsl:value-of select="name()"/>
- <xsl:text>\": </xsl:text>
+ <xsl:text>": </xsl:text>
<xsl:call-template name="JSONProperties">
<xsl:with-param name="parent" select="'Yes'"></xsl:with-param>
</xsl:call-template>
<xsl:choose>
<xsl:when test="following-sibling::*">, </xsl:when>
@@ -802,53 +802,53 @@
<xsl:value-of select="."/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="substring(.,1,1) = '!'">
- <xsl:text>#{(</xsl:text>
- <xsl:value-of select="substring(.,2)"/>
- <xsl:text>).to_json}</xsl:text>
+ <xsl:text>🠊("</xsl:text>
+ <xsl:value-of select="str:replace(str:replace(substring(.,2),'\','\\'),'"','\"')"/>
+ <xsl:text>")</xsl:text>
</xsl:when>
<xsl:otherwise>
- <xsl:text>\"</xsl:text>
+ <xsl:text>"</xsl:text>
<xsl:value-of select="str:replace(str:replace(.,'\','\\'),'"','\\\"')"/>
- <xsl:text>\"</xsl:text>
+ <xsl:text>"</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
- <xsl:text>\"</xsl:text>
+ <xsl:text>"</xsl:text>
<xsl:value-of select="name()"/>
- <xsl:text>\": </xsl:text>
+ <xsl:text>": </xsl:text>
<xsl:choose>
<xsl:when test="string(number(.)) = .">
<xsl:value-of select="."/>
</xsl:when>
<xsl:otherwise>
- <xsl:text>\"</xsl:text>
+ <xsl:text>"</xsl:text>
<xsl:choose>
<xsl:when test="substring(.,1,1) = '!'">
- <xsl:text>#{</xsl:text>
+ <xsl:text>>🠊("</xsl:text>
<xsl:value-of select="str:replace(str:replace(substring(.,2),'\','\\'),'"','\\\"')"/>
- <xsl:text>}</xsl:text>
+ <xsl:text>")</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="str:replace(str:replace(.,'\','\\'),'"','\\\"')"/>
</xsl:otherwise>
</xsl:choose>
- <xsl:text>\"</xsl:text>
+ <xsl:text>"</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="count(*[name()=$childName]) > 1">
- <xsl:text>{ \"</xsl:text>
+ <xsl:text>{ "</xsl:text>
<xsl:value-of select="$childName"/>
- <xsl:text>\": [ </xsl:text>
+ <xsl:text>": [ </xsl:text>
<xsl:apply-templates select="*" mode="JSONArrayElement"/>
<xsl:text>] }</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:if test="text()[normalize-space(.)]">
@@ -858,49 +858,49 @@
<xsl:apply-templates select="@*" mode="JSONSUB"/>
<xsl:apply-templates select="*" mode="JSONSUB"/>
<xsl:text>}</xsl:text>
<xsl:if test="text()[normalize-space(.)]">
<xsl:text>, </xsl:text>
- <xsl:text>\"</xsl:text>
+ <xsl:text>"</xsl:text>
<xsl:choose>
<xsl:when test="substring(.,1,1) = '!'">
- <xsl:text>#{</xsl:text>
+ <xsl:text>>🠊("</xsl:text>
<xsl:value-of select="str:replace(str:replace(substring(.,2),'\','\\'),'"','\\\"')"/>
- <xsl:text>}</xsl:text>
+ <xsl:text>")</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="str:replace(str:replace(.,'\','\\'),'"','\\\"')"/>
</xsl:otherwise>
</xsl:choose>
- <xsl:text>\"</xsl:text>
+ <xsl:text>"</xsl:text>
<xsl:text>]</xsl:text>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- JSON Attribute Property -->
<xsl:template match="@*" mode="JSONSUB">
- <xsl:text>\"@</xsl:text>
+ <xsl:text>"@</xsl:text>
<xsl:value-of select="name()"/>
- <xsl:text>\": </xsl:text>
+ <xsl:text>": </xsl:text>
<xsl:choose>
<xsl:when test="number(.) = .">
<xsl:value-of select="."/>
</xsl:when>
<xsl:otherwise>
- <xsl:text>\"</xsl:text>
+ <xsl:text>"</xsl:text>
<xsl:choose>
<xsl:when test="substring(.,1,1) = '!'">
- <xsl:text>#{</xsl:text>
+ <xsl:text>>🠊("</xsl:text>
<xsl:value-of select="str:replace(str:replace(substring(.,2),'\','\\'),'"','\\\"')"/>
- <xsl:text>}</xsl:text>
+ <xsl:text>")</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="str:replace(str:replace(.,'\','\\'),'"','\\\"')"/>
</xsl:otherwise>
</xsl:choose>
- <xsl:text>\"</xsl:text>
+ <xsl:text>"</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="not(position() = last())">
<xsl:text>, </xsl:text>