plcopen/instances_path.xslt
changeset 1949 c266fbaae0f6
parent 1946 95fa4e05e30f
child 2626 39d78c530cbb
equal deleted inserted replaced
1948:b9a3f771aaab 1949:c266fbaae0f6
     4   <xsl:param name="instance_type"/>
     4   <xsl:param name="instance_type"/>
     5   <xsl:template match="text()"/>
     5   <xsl:template match="text()"/>
     6   <xsl:variable name="project" select="ns:GetProject()"/>
     6   <xsl:variable name="project" select="ns:GetProject()"/>
     7   <xsl:variable name="stdlib" select="ns:GetStdLibs()"/>
     7   <xsl:variable name="stdlib" select="ns:GetStdLibs()"/>
     8   <xsl:variable name="extensions" select="ns:GetExtensions()"/>
     8   <xsl:variable name="extensions" select="ns:GetExtensions()"/>
     9   <xsl:variable name="all" select="$project | $stdlib | $extensions"/>
     9   <xsl:variable name="all_types" select="($project | $stdlib | $extensions)/ppx:types"/>
    10   <xsl:template match="ppx:project">
    10   <xsl:template match="ppx:project">
    11     <xsl:apply-templates select="ppx:instances/ppx:configurations/ppx:configuration"/>
    11     <xsl:apply-templates select="ppx:instances/ppx:configurations/ppx:configuration"/>
    12   </xsl:template>
    12   </xsl:template>
    13   <xsl:template match="ppx:configuration">
    13   <xsl:template match="ppx:configuration">
    14     <xsl:apply-templates select="ppx:globalVars/ppx:variable[ppx:type/ppx:derived] | ppx:resource">
    14     <xsl:apply-templates select="ppx:globalVars/ppx:variable[ppx:type/ppx:derived] | ppx:resource">
    43       </xsl:when>
    43       </xsl:when>
    44       <xsl:otherwise>
    44       <xsl:otherwise>
    45         <xsl:variable name="type_name">
    45         <xsl:variable name="type_name">
    46           <xsl:value-of select="@typeName"/>
    46           <xsl:value-of select="@typeName"/>
    47         </xsl:variable>
    47         </xsl:variable>
    48         <xsl:apply-templates select="$all/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |                          $all/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name]">
    48         <xsl:apply-templates select="$all_types/ppx:pous/ppx:pou[@name=$type_name] |                          $all_types/ppx:dataTypes/ppx:dataType[@name=$type_name]">
    49           <xsl:with-param name="instance_path">
    49           <xsl:with-param name="instance_path">
    50             <xsl:value-of select="$pou_instance_path"/>
    50             <xsl:value-of select="$pou_instance_path"/>
    51           </xsl:with-param>
    51           </xsl:with-param>
    52         </xsl:apply-templates>
    52         </xsl:apply-templates>
    53       </xsl:otherwise>
    53       </xsl:otherwise>
    90       </xsl:when>
    90       </xsl:when>
    91       <xsl:otherwise>
    91       <xsl:otherwise>
    92         <xsl:variable name="type_name">
    92         <xsl:variable name="type_name">
    93           <xsl:value-of select="@name"/>
    93           <xsl:value-of select="@name"/>
    94         </xsl:variable>
    94         </xsl:variable>
    95         <xsl:apply-templates select="$all/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |                          $all/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name]">
    95         <xsl:apply-templates select="$all_types/ppx:pous/ppx:pou[@name=$type_name] |                          $all_types/ppx:dataTypes/ppx:dataType[@name=$type_name]">
    96           <xsl:with-param name="instance_path">
    96           <xsl:with-param name="instance_path">
    97             <xsl:value-of select="$variable_path"/>
    97             <xsl:value-of select="$variable_path"/>
    98           </xsl:with-param>
    98           </xsl:with-param>
    99         </xsl:apply-templates>
    99         </xsl:apply-templates>
   100       </xsl:otherwise>
   100       </xsl:otherwise>