plcopen/instances_path.xslt
changeset 1937 986dbad48ab7
parent 1936 b85b13b1c2ec
child 1938 87136f8697e3
equal deleted inserted replaced
1936:b85b13b1c2ec 1937:986dbad48ab7
     1 <?xml version="1.0"?>
     1 <?xml version="1.0"?>
     2 <xsl:stylesheet xmlns:exsl="http://exslt.org/common" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:ppx="http://www.plcopen.org/xml/tc6_0201" xmlns:ns="instances_ns" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" extension-element-prefixes="ns" version="1.0" exclude-result-prefixes="ns">
     2 <xsl:stylesheet xmlns:exsl="http://exslt.org/common" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:ppx="http://www.plcopen.org/xml/tc6_0201" xmlns:ns="instances_ns" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" extension-element-prefixes="ns" version="1.0" exclude-result-prefixes="ns">
     3   <xsl:output method="xml"/>
     3   <xsl:output method="xml"/>
     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">
     6   <xsl:variable name="project" select="ns:GetProject()"/>
     7     <xsl:copy-of select="document('project')/project/*"/>
     7   <xsl:variable name="stdlib" select="ns:GetStdLibs()"/>
     8   </xsl:variable>
     8   <xsl:variable name="extensions" select="ns:GetExtensions()"/>
     9   <xsl:variable name="stdlib">
     9   <xsl:variable name="all" select="$project | $stdlib | $extensions"/>
    10     <xsl:copy-of select="document('stdlib')/stdlib/*"/>
       
    11   </xsl:variable>
       
    12   <xsl:variable name="extensions">
       
    13     <xsl:copy-of select="document('extensions')/extensions/*"/>
       
    14   </xsl:variable>
       
    15   <xsl:template match="ppx:project">
    10   <xsl:template match="ppx:project">
    16     <instances>
    11     <instances>
    17       <xsl:apply-templates select="ppx:instances/ppx:configurations/ppx:configuration"/>
    12       <xsl:apply-templates select="ppx:instances/ppx:configurations/ppx:configuration"/>
    18     </instances>
    13     </instances>
    19   </xsl:template>
    14   </xsl:template>
    50       </xsl:when>
    45       </xsl:when>
    51       <xsl:otherwise>
    46       <xsl:otherwise>
    52         <xsl:variable name="type_name">
    47         <xsl:variable name="type_name">
    53           <xsl:value-of select="@typeName"/>
    48           <xsl:value-of select="@typeName"/>
    54         </xsl:variable>
    49         </xsl:variable>
    55         <xsl:apply-templates select="exsl:node-set($project)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |&#10;                         exsl:node-set($project)/ppx:project/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name] |&#10;                         exsl:node-set($stdlib)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |&#10;                         exsl:node-set($stdlib)/ppx:project/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name] |&#10;                         exsl:node-set($extensions)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |&#10;                         exsl:node-set($extensions)/ppx:project/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name]">
    50         <xsl:apply-templates select="$all/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |&#10;                         $all/ppx:project/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name]">
    56           <xsl:with-param name="instance_path">
    51           <xsl:with-param name="instance_path">
    57             <xsl:value-of select="$pou_instance_path"/>
    52             <xsl:value-of select="$pou_instance_path"/>
    58           </xsl:with-param>
    53           </xsl:with-param>
    59         </xsl:apply-templates>
    54         </xsl:apply-templates>
    60       </xsl:otherwise>
    55       </xsl:otherwise>
    97       </xsl:when>
    92       </xsl:when>
    98       <xsl:otherwise>
    93       <xsl:otherwise>
    99         <xsl:variable name="type_name">
    94         <xsl:variable name="type_name">
   100           <xsl:value-of select="@name"/>
    95           <xsl:value-of select="@name"/>
   101         </xsl:variable>
    96         </xsl:variable>
   102         <xsl:apply-templates select="exsl:node-set($project)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |&#10;                         exsl:node-set($project)/ppx:project/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name] |&#10;                         exsl:node-set($stdlib)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |&#10;                         exsl:node-set($stdlib)/ppx:project/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name] |&#10;                         exsl:node-set($extensions)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |&#10;                         exsl:node-set($extensions)/ppx:project/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name]">
    97         <xsl:apply-templates select="$all/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |&#10;                         $all/ppx:project/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name]">
   103           <xsl:with-param name="instance_path">
    98           <xsl:with-param name="instance_path">
   104             <xsl:value-of select="$variable_path"/>
    99             <xsl:value-of select="$variable_path"/>
   105           </xsl:with-param>
   100           </xsl:with-param>
   106         </xsl:apply-templates>
   101         </xsl:apply-templates>
   107       </xsl:otherwise>
   102       </xsl:otherwise>