plcopen/instance_tagname.xslt
author Laurent Bessard
Tue, 24 Sep 2013 12:42:34 +0200
changeset 1325 76e52d5fcffd
parent 1321 83f41ea00b97
child 1326 e2c11668addf
permissions -rw-r--r--
Fixed time consuming function when loading VariablePanel
1321
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
     1
<xsl:stylesheet version="1.0"
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
     2
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
     3
    xmlns:ppx="http://www.plcopen.org/xml/tc6_0201"
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
     4
    xmlns:xhtml="http://www.w3.org/1999/xhtml"
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
     5
    xmlns:ns="instance_tagname_ns"
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
     6
    extension-element-prefixes="ns"
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
     7
    exclude-result-prefixes="ns">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
     8
  <xsl:param name="instance_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
     9
  <xsl:template name="element_name">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    10
    <xsl:param name="path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    11
    <xsl:choose>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    12
      <xsl:when test="contains($path,'.')">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    13
        <xsl:value-of select="substring-before($path,'.')"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    14
      </xsl:when>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    15
      <xsl:otherwise>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    16
        <xsl:value-of select="$path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    17
      </xsl:otherwise>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    18
    </xsl:choose>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    19
  </xsl:template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    20
  <xsl:template name="next_path">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    21
    <xsl:param name="path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    22
    <xsl:choose>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    23
      <xsl:when test="contains($path,'.')">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    24
        <xsl:value-of select="substring-after($path,'.')"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    25
      </xsl:when>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    26
    </xsl:choose>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    27
  </xsl:template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    28
  <xsl:template match="ppx:project">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    29
    <xsl:variable name="config_name">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    30
      <xsl:call-template name="element_name">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    31
        <xsl:with-param name="path" select="$instance_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    32
      </xsl:call-template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    33
    </xsl:variable>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    34
    <xsl:apply-templates select="ppx:instances/ppx:configurations/ppx:configuration[@name=$config_name]">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    35
      <xsl:with-param name="element_path">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    36
        <xsl:call-template name="next_path">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    37
          <xsl:with-param name="path" select="$instance_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    38
        </xsl:call-template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    39
      </xsl:with-param>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    40
    </xsl:apply-templates>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    41
  </xsl:template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    42
  <xsl:template match="ppx:configuration">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    43
    <xsl:param name="element_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    44
    <xsl:choose>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    45
      <xsl:when test="$element_path!=''">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    46
        <xsl:variable name="child_name">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    47
	      <xsl:call-template name="element_name">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    48
	        <xsl:with-param name="path" select="$element_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    49
	      </xsl:call-template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    50
	    </xsl:variable>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    51
        <xsl:apply-templates select="ppx:resource[@name=$child_name] | ppx:globalVars/ppx:variable[@name=$child_name]/ppx:type/*[self::ppx:derived or self::ppx:struct or self::ppx:array]">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    52
          <xsl:with-param name="element_path">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    53
            <xsl:call-template name="next_path">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    54
		      <xsl:with-param name="path" select="$element_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    55
		    </xsl:call-template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    56
		  </xsl:with-param>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    57
        </xsl:apply-templates>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    58
      </xsl:when>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    59
      <xsl:otherwise>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    60
        <ns:config_tagname>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    61
          <xsl:attribute name="name">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    62
            <xsl:value-of select="@name"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    63
          </xsl:attribute>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    64
        </ns:config_tagname>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    65
      </xsl:otherwise>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    66
    </xsl:choose>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    67
  </xsl:template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    68
  <xsl:template match="ppx:resource">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    69
    <xsl:param name="element_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    70
    <xsl:choose>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    71
      <xsl:when test="$element_path!=''">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    72
	    <xsl:variable name="child_name">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    73
	      <xsl:call-template name="element_name">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    74
	        <xsl:with-param name="path" select="$element_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    75
	      </xsl:call-template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    76
	    </xsl:variable>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    77
        <xsl:apply-templates select="ppx:pouInstance[@name=$child_name] | ppx:task|ppx:pouInstance[@name=$child_name] | ppx:globalVars/ppx:variable[@name=$child_name]/ppx:type/*[self::ppx:derived or self::ppx:struct or self::ppx:array]">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    78
          <xsl:with-param name="element_path">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    79
            <xsl:call-template name="next_path">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    80
              <xsl:with-param name="path" select="$element_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    81
            </xsl:call-template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    82
          </xsl:with-param>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    83
        </xsl:apply-templates>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    84
      </xsl:when>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    85
      <xsl:otherwise>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    86
        <ns:resource_tagname>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    87
          <xsl:attribute name="name">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    88
            <xsl:value-of select="@name"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    89
          </xsl:attribute>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    90
          <xsl:attribute name="config_name">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    91
            <xsl:value-of select="ancestor::ppx:configuration/@name"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    92
          </xsl:attribute>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    93
        </ns:resource_tagname>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    94
      </xsl:otherwise>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    95
    </xsl:choose>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    96
  </xsl:template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    97
  <xsl:template match="ppx:pouInstance">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    98
    <xsl:param name="element_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    99
    <ns:instance_definition>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   100
      <xsl:attribute name="name">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   101
        <xsl:value-of select="@typeName"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   102
      </xsl:attribute>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   103
      <xsl:attribute name="path">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   104
        <xsl:value-of select="$element_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   105
      </xsl:attribute>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   106
    </ns:instance_definition>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   107
  </xsl:template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   108
  <xsl:template match="ppx:pou">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   109
    <xsl:param name="element_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   110
    <xsl:variable name="child_name">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   111
      <xsl:call-template name="element_name">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   112
        <xsl:with-param name="path" select="$element_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   113
      </xsl:call-template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   114
    </xsl:variable>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   115
    <xsl:variable name="next_child_path">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   116
      <xsl:call-template name="next_path">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   117
        <xsl:with-param name="path" select="$element_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   118
      </xsl:call-template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   119
    </xsl:variable>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   120
    <xsl:apply-templates select="ppx:interface/*/ppx:variable[@name=$child_name]/ppx:type/*[self::ppx:derived or self::ppx:struct or self::ppx:array]">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   121
      <xsl:with-param name="next_child_path" select="next_child_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   122
    </xsl:apply-templates>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   123
    <xsl:apply-templates select="ppx:actions/ppx:action[@name=$child_name]">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   124
      <xsl:with-param name="next_child_path" select="next_child_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   125
    </xsl:apply-templates>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   126
    <xsl:apply-templates select="ppx:transitions/ppx:transition[@name=$child_name]">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   127
      <xsl:with-param name="next_child_path" select="next_child_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   128
    </xsl:apply-templates>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   129
  </xsl:template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   130
  <xsl:template match="ppx:action">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   131
    <ns:action_tagname>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   132
      <xsl:attribute name="name">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   133
        <xsl:value-of select="@name"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   134
      </xsl:attribute>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   135
      <xsl:attribute name="pou_name">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   136
        <xsl:value-of select="ancestor::ppx:pou/@name"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   137
      </xsl:attribute>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   138
    </ns:action_tagname>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   139
  </xsl:template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   140
  <xsl:template match="ppx:transition">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   141
    <ns:transition_tagname>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   142
      <xsl:attribute name="name">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   143
        <xsl:value-of select="@name"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   144
      </xsl:attribute>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   145
      <xsl:attribute name="pou_name">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   146
        <xsl:value-of select="ancestor::ppx:pou/@name"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   147
      </xsl:attribute>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   148
    </ns:transition_tagname>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   149
  </xsl:template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   150
  <xsl:template name="ppx:dataType">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   151
    <xsl:param name="element_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   152
    <xsl:apply-templates select="ppx:baseType/*[self::ppx:derived or self::ppx:struct or self::ppx:array]">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   153
      <xsl:with-param name="element_path" select="element_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   154
    </xsl:apply-templates>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   155
  </xsl:template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   156
  <xsl:template match="ppx:derived">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   157
    <xsl:param name="element_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   158
    <ns:instance_definition>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   159
      <xsl:attribute name="name">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   160
        <xsl:value-of select="@name"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   161
      </xsl:attribute>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   162
      <xsl:attribute name="path">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   163
        <xsl:value-of select="$element_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   164
      </xsl:attribute>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   165
    </ns:instance_definition>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   166
  </xsl:template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   167
  <xsl:template match="array">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   168
    <xsl:param name="element_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   169
    <xsl:apply-templates select="ppx:baseType/*[self::ppx:derived or self::ppx:struct or self::ppx:array]">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   170
      <xsl:with-param name="element_path" select="element_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   171
    </xsl:apply-templates>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   172
  </xsl:template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   173
  <xsl:template match="struct">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   174
    <xsl:param name="element_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   175
    <xsl:variable name="child_name">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   176
      <xsl:call-template name="element_name">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   177
        <xsl:with-param name="path" select="$element_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   178
      </xsl:call-template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   179
    </xsl:variable>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   180
    <xsl:variable name="next_child_path">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   181
      <xsl:call-template name="next_path">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   182
        <xsl:with-param name="path" select="$element_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   183
      </xsl:call-template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   184
    </xsl:variable>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   185
    <xsl:apply-templates select="ppx:variable[@name=$child_name]/ppx:type/*[self::ppx:derived or self::ppx:struct or self::ppx:array]">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   186
      <xsl:with-param name="element_path" select="element_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   187
    </xsl:apply-templates>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   188
  </xsl:template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   189
  <xsl:template match="pou_instance">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   190
    <xsl:choose>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   191
      <xsl:when test="@pou_path!=''">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   192
        <xsl:apply-templates>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   193
          <xsl:with-param name="element_path" select="@pou_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   194
        </xsl:apply-templates>        
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   195
      </xsl:when>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   196
      <xsl:otherwise>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   197
        <ns:pou_tagname>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   198
          <xsl:attribute name="name">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   199
            <xsl:value-of select="ppx:pou/@name"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   200
          </xsl:attribute>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   201
        </ns:pou_tagname>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   202
      </xsl:otherwise>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   203
    </xsl:choose>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   204
  </xsl:template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   205
  <xsl:template match="datatype_instance">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   206
    <xsl:apply-templates>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   207
      <xsl:with-param name="element_path" select="@datatype_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   208
    </xsl:apply-templates>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   209
  </xsl:template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   210
</xsl:stylesheet>