plcopen/instance_tagname.xslt
author Andrey Skvortsov <andrej.skvortzov@gmail.com>
Wed, 18 Oct 2017 12:23:19 +0300
changeset 1876 995df4804221
parent 1351 a546a63ce1bf
child 1936 b85b13b1c2ec
permissions -rw-r--r--
fix pylint warning '(expression-not-assigned) Expression "X" is assigned to nothing'
1351
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
     1
<?xml version="1.0"?>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
     2
<xsl:stylesheet xmlns:func="http://exslt.org/functions" xmlns:dyn="http://exslt.org/dynamic" xmlns:str="http://exslt.org/strings" xmlns:math="http://exslt.org/math" xmlns:exsl="http://exslt.org/common" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:yml="http://fdik.org/yml" xmlns:set="http://exslt.org/sets" xmlns:ppx="http://www.plcopen.org/xml/tc6_0201" xmlns:ns="instance_tagname_ns" xmlns:regexp="http://exslt.org/regular-expressions" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" extension-element-prefixes="ns" version="1.0" exclude-result-prefixes="ns">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
     3
  <xsl:output method="xml"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
     4
  <xsl:variable name="space" select="'                                                                                                                                                                                                        '"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
     5
  <xsl:param name="autoindent" select="4"/>
1321
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
     6
  <xsl:param name="instance_path"/>
1351
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
     7
  <xsl:variable name="project">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
     8
    <xsl:copy-of select="document('project')/project/*"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
     9
  </xsl:variable>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    10
  <xsl:variable name="stdlib">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    11
    <xsl:copy-of select="document('stdlib')/stdlib/*"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    12
  </xsl:variable>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    13
  <xsl:variable name="extensions">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    14
    <xsl:copy-of select="document('extensions')/extensions/*"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    15
  </xsl:variable>
1321
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    16
  <xsl:template name="element_name">
1351
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    17
    <xsl:param name="_indent" select="0"/>
1321
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    18
    <xsl:param name="path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    19
    <xsl:choose>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    20
      <xsl:when test="contains($path,'.')">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    21
        <xsl:value-of select="substring-before($path,'.')"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    22
      </xsl:when>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    23
      <xsl:otherwise>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    24
        <xsl:value-of select="$path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    25
      </xsl:otherwise>
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 name="next_path">
1351
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    29
    <xsl:param name="_indent" select="0"/>
1321
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    30
    <xsl:param name="path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    31
    <xsl:choose>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    32
      <xsl:when test="contains($path,'.')">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    33
        <xsl:value-of select="substring-after($path,'.')"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    34
      </xsl:when>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    35
    </xsl:choose>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    36
  </xsl:template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    37
  <xsl:template match="ppx:project">
1351
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    38
    <xsl:param name="_indent" select="0"/>
1321
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    39
    <xsl:variable name="config_name">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    40
      <xsl:call-template name="element_name">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    41
        <xsl:with-param name="path" select="$instance_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    42
      </xsl:call-template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    43
    </xsl:variable>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    44
    <xsl:apply-templates select="ppx:instances/ppx:configurations/ppx:configuration[@name=$config_name]">
1351
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    45
      <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
1321
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    46
      <xsl:with-param name="element_path">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    47
        <xsl:call-template name="next_path">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    48
          <xsl:with-param name="path" select="$instance_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:with-param>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    51
    </xsl:apply-templates>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    52
  </xsl:template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    53
  <xsl:template match="ppx:configuration">
1351
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    54
    <xsl:param name="_indent" select="0"/>
1321
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    55
    <xsl:param name="element_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    56
    <xsl:choose>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    57
      <xsl:when test="$element_path!=''">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    58
        <xsl:variable name="child_name">
1351
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    59
          <xsl:call-template name="element_name">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    60
            <xsl:with-param name="path" select="$element_path"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    61
          </xsl:call-template>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    62
        </xsl:variable>
1321
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    63
        <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]">
1351
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    64
          <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
1321
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    65
          <xsl:with-param name="element_path">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    66
            <xsl:call-template name="next_path">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    67
              <xsl:with-param name="path" select="$element_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    68
            </xsl:call-template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    69
          </xsl:with-param>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    70
        </xsl:apply-templates>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    71
      </xsl:when>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    72
      <xsl:otherwise>
1351
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    73
        <xsl:value-of select="ns:ConfigTagName(@name)"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    74
      </xsl:otherwise>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    75
    </xsl:choose>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    76
  </xsl:template>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    77
  <xsl:template match="ppx:resource">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    78
    <xsl:param name="_indent" select="0"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    79
    <xsl:param name="element_path"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    80
    <xsl:choose>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    81
      <xsl:when test="$element_path!=''">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    82
        <xsl:variable name="child_name">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    83
          <xsl:call-template name="element_name">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    84
            <xsl:with-param name="path">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    85
              <xsl:value-of select="$element_path"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    86
            </xsl:with-param>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    87
          </xsl:call-template>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    88
        </xsl:variable>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    89
        <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]">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    90
          <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    91
          <xsl:with-param name="element_path">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    92
            <xsl:call-template name="next_path">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    93
              <xsl:with-param name="path" select="$element_path"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    94
            </xsl:call-template>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    95
          </xsl:with-param>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    96
        </xsl:apply-templates>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    97
      </xsl:when>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    98
      <xsl:otherwise>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    99
        <xsl:value-of select="ns:ResourceTagName(ancestor::ppx:configuration/@name, @name)"/>
1321
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   100
      </xsl:otherwise>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   101
    </xsl:choose>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   102
  </xsl:template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   103
  <xsl:template match="ppx:pouInstance">
1351
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   104
    <xsl:param name="_indent" select="0"/>
1321
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   105
    <xsl:param name="element_path"/>
1351
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   106
    <xsl:variable name="type_name">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   107
      <xsl:value-of select="@typeName"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   108
    </xsl:variable>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   109
    <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]">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   110
      <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   111
      <xsl:with-param name="element_path" select="$element_path"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   112
    </xsl:apply-templates>
1321
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   113
  </xsl:template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   114
  <xsl:template match="ppx:pou">
1351
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   115
    <xsl:param name="_indent" select="0"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   116
    <xsl:param name="element_path"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   117
    <xsl:choose>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   118
      <xsl:when test="$element_path!=''">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   119
        <xsl:variable name="child_name">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   120
          <xsl:call-template name="element_name">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   121
            <xsl:with-param name="path" select="$element_path"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   122
          </xsl:call-template>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   123
        </xsl:variable>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   124
        <xsl:apply-templates select="ppx:interface/*/ppx:variable[@name=$child_name]/ppx:type/*[self::ppx:derived or self::ppx:struct or self::ppx:array]">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   125
          <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   126
          <xsl:with-param name="element_path">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   127
            <xsl:call-template name="next_path">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   128
              <xsl:with-param name="path" select="$element_path"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   129
            </xsl:call-template>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   130
          </xsl:with-param>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   131
        </xsl:apply-templates>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   132
        <xsl:apply-templates select="ppx:actions/ppx:action[@name=$child_name] | ppx:transitions/ppx:transition[@name=$child_name]">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   133
          <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   134
        </xsl:apply-templates>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   135
      </xsl:when>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   136
      <xsl:otherwise>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   137
        <xsl:variable name="name">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   138
          <xsl:value-of select="@name"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   139
        </xsl:variable>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   140
        <xsl:value-of select="ns:PouTagName($name)"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   141
      </xsl:otherwise>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   142
    </xsl:choose>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   143
  </xsl:template>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   144
  <xsl:template match="ppx:action">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   145
    <xsl:param name="_indent" select="0"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   146
    <xsl:value-of select="ns:ActionTagName(ancestor::ppx:pou/@name, @name)"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   147
  </xsl:template>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   148
  <xsl:template match="ppx:transition">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   149
    <xsl:param name="_indent" select="0"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   150
    <xsl:value-of select="ns:TransitionTagName(ancestor::ppx:pou/@name, @name)"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   151
  </xsl:template>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   152
  <xsl:template match="ppx:dataType">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   153
    <xsl:param name="_indent" select="0"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   154
    <xsl:param name="element_path"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   155
    <xsl:apply-templates select="ppx:baseType/*[self::ppx:derived or self::ppx:struct or self::ppx:array]">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   156
      <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   157
      <xsl:with-param name="element_path" select="$element_path"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   158
    </xsl:apply-templates>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   159
  </xsl:template>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   160
  <xsl:template match="ppx:derived">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   161
    <xsl:param name="_indent" select="0"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   162
    <xsl:param name="element_path"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   163
    <xsl:variable name="type_name">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   164
      <xsl:value-of select="@name"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   165
    </xsl:variable>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   166
    <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]">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   167
      <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   168
      <xsl:with-param name="element_path" select="$element_path"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   169
    </xsl:apply-templates>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   170
  </xsl:template>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   171
  <xsl:template match="ppx:array">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   172
    <xsl:param name="_indent" select="0"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   173
    <xsl:param name="element_path"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   174
    <xsl:apply-templates select="ppx:baseType/*[self::ppx:derived or self::ppx:struct or self::ppx:array]">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   175
      <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   176
      <xsl:with-param name="element_path" select="$element_path"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   177
    </xsl:apply-templates>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   178
  </xsl:template>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   179
  <xsl:template match="ppx:struct">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   180
    <xsl:param name="_indent" select="0"/>
1321
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   181
    <xsl:param name="element_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   182
    <xsl:variable name="child_name">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   183
      <xsl:call-template name="element_name">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   184
        <xsl:with-param name="path" select="$element_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   185
      </xsl:call-template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   186
    </xsl:variable>
1351
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   187
    <xsl:apply-templates select="ppx:variable[@name=$child_name]/ppx:type/*[self::ppx:derived or self::ppx:struct or self::ppx:array]">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   188
      <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
1326
e2c11668addf Fixed instance type tagname computing xslt stylesheet
Laurent Bessard
parents: 1321
diff changeset
   189
      <xsl:with-param name="element_path">
e2c11668addf Fixed instance type tagname computing xslt stylesheet
Laurent Bessard
parents: 1321
diff changeset
   190
        <xsl:call-template name="next_path">
e2c11668addf Fixed instance type tagname computing xslt stylesheet
Laurent Bessard
parents: 1321
diff changeset
   191
          <xsl:with-param name="path" select="$element_path"/>
e2c11668addf Fixed instance type tagname computing xslt stylesheet
Laurent Bessard
parents: 1321
diff changeset
   192
        </xsl:call-template>
e2c11668addf Fixed instance type tagname computing xslt stylesheet
Laurent Bessard
parents: 1321
diff changeset
   193
      </xsl:with-param>
e2c11668addf Fixed instance type tagname computing xslt stylesheet
Laurent Bessard
parents: 1321
diff changeset
   194
    </xsl:apply-templates>
1321
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   195
  </xsl:template>
1351
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   196
</xsl:stylesheet>