Avoid endline escaping in multiline xpath epressions in xslt. '
' Is apparently ignored but never know...
authorEdouard Tisserant <edouard.tisserant@gmail.com>
Sun, 18 Feb 2018 22:29:35 +0100
changeset 1946 95fa4e05e30f
parent 1945 90bf6bd94b94
child 1947 7c2cd9d33070
Avoid endline escaping in multiline xpath epressions in xslt. '&#10;' Is apparently ignored but never know...
plcopen/instances_path.xslt
plcopen/instances_path.ysl2
plcopen/pou_variables.xslt
plcopen/pou_variables.ysl2
--- a/plcopen/instances_path.xslt	Sun Feb 18 21:51:33 2018 +0100
+++ b/plcopen/instances_path.xslt	Sun Feb 18 22:29:35 2018 +0100
@@ -45,7 +45,7 @@
         <xsl:variable name="type_name">
           <xsl:value-of select="@typeName"/>
         </xsl:variable>
-        <xsl:apply-templates select="$all/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |&#10;                         $all/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name]">
+        <xsl:apply-templates select="$all/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |                          $all/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name]">
           <xsl:with-param name="instance_path">
             <xsl:value-of select="$pou_instance_path"/>
           </xsl:with-param>
@@ -92,7 +92,7 @@
         <xsl:variable name="type_name">
           <xsl:value-of select="@name"/>
         </xsl:variable>
-        <xsl:apply-templates select="$all/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |&#10;                         $all/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name]">
+        <xsl:apply-templates select="$all/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |                          $all/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name]">
           <xsl:with-param name="instance_path">
             <xsl:value-of select="$variable_path"/>
           </xsl:with-param>
--- a/plcopen/instances_path.ysl2	Sun Feb 18 21:51:33 2018 +0100
+++ b/plcopen/instances_path.ysl2	Sun Feb 18 22:29:35 2018 +0100
@@ -45,7 +45,7 @@
             }
             otherwise {
                 variable "type_name" > «@typeName»
-                apply """$all/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |
+                apply """$all/ppx:types/ppx:pous/ppx:pou[@name=$type_name] | \
                          $all/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name]""" {
                     with "instance_path" > «$pou_instance_path»
                 }
@@ -83,7 +83,7 @@
             }
             otherwise {
                 variable "type_name" > «@name»
-                apply """$all/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |
+                apply """$all/ppx:types/ppx:pous/ppx:pou[@name=$type_name] | \
                          $all/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name]""" {
                     with "instance_path" > «$variable_path»
                 }
--- a/plcopen/pou_variables.xslt	Sun Feb 18 21:51:33 2018 +0100
+++ b/plcopen/pou_variables.xslt	Sun Feb 18 22:29:35 2018 +0100
@@ -264,7 +264,7 @@
   </xsl:template>
   <xsl:template mode="var_debug" match="*[self::ppx:type or self::ppx:baseType]/ppx:derived">
     <xsl:variable name="type_name" select="@name"/>
-    <xsl:variable name="datatype_infos" select="&#10;            $project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |&#10;            $all/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name]&#10;        "/>
+    <xsl:variable name="datatype_infos" select="             $project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |             $all/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name]         "/>
     <xsl:choose>
       <xsl:when test="$datatype_infos">
         <xsl:apply-templates mode="var_debug" select="$datatype_infos"/>
--- a/plcopen/pou_variables.ysl2	Sun Feb 18 21:51:33 2018 +0100
+++ b/plcopen/pou_variables.ysl2	Sun Feb 18 22:29:35 2018 +0100
@@ -237,9 +237,9 @@
     
     template "*[self::ppx:type or self::ppx:baseType]/ppx:derived", mode="var_debug" {
         variable "type_name", "@name";
-        variable "datatype_infos", """
-            $project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |
-            $all/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name]
+        variable "datatype_infos", """ \
+            $project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] | \
+            $all/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name] \
         """;
         choose {
             when "$datatype_infos" {