plcopen/instance_tagname.xslt
author Andrey Skvortsov <andrej.skvortzov@gmail.com>
Wed, 13 Mar 2019 11:47:03 +0300
changeset 2537 eb4a4cc41914
parent 1950 752ec68da94d
child 2637 507737ec2b9a
permissions -rw-r--r--
Fix various pylint and pep8 errors

Check basic code-style problems for PEP-8
pep8 version: 2.4.0
./connectors/PYRO/__init__.py:57:43: E261 at least two spaces before inline comment
./connectors/SchemeEditor.py:29:21: E128 continuation line under-indented for visual indent
./controls/IDBrowser.py:101:23: E127 continuation line over-indented for visual indent
./controls/IDBrowser.py:102:23: E127 continuation line over-indented for visual indent

Check for problems using pylint ...
No config file found, using default configuration
pylint 1.9.4,
astroid 1.6.5
Python 2.7.16rc1 (default, Feb 18 2019, 11:05:09)
[GCC 8.2.0]
Use multiple threads for pylint
Using config file /home/developer/WorkData/PLC/beremiz/beremiz/.pylint
************* Module connectors.PYRO_dialog
connectors/PYRO_dialog.py:9: [W0611(unused-import), ] Unused import wx
************* Module connectors
connectors/__init__.py:32: [W1652(deprecated-types-field), ] Accessing a deprecated fields on the types module
connectors/__init__.py:32: [C0411(wrong-import-order), ] standard import "from types import ClassType" should be placed before "from connectors.ConnectorBase import ConnectorBase"
************* Module connectors.PYRO.PSK_Adapter
connectors/PYRO/PSK_Adapter.py:7: [C0411(wrong-import-order), ] standard import "import ssl" should be placed before "import sslpsk"
************* Module connectors.SchemeEditor
connectors/SchemeEditor.py:29: [C0330(bad-continuation), ] Wrong continued indentation (add 1 space).
wx.ALIGN_CENTER_VERTICAL),
^|
connectors/SchemeEditor.py:42: [W0631(undefined-loop-variable), SchemeEditor.__init__] Using possibly undefined loop variable 'tag'
************* Module runtime.WampClient
runtime/WampClient.py:138: [W1612(unicode-builtin), WampSession.onJoin] unicode built-in referenced
runtime/WampClient.py:154: [W1612(unicode-builtin), WampSession.publishWithOwnID] unicode built-in referenced
runtime/WampClient.py:346: [W1612(unicode-builtin), PublishEvent] unicode built-in referenced
runtime/WampClient.py:351: [W1612(unicode-builtin), PublishEventWithOwnID] unicode built-in referenced
runtime/WampClient.py:31: [W0611(unused-import), ] Unused str imported from builtins as text
************* Module runtime.PLCObject
runtime/PLCObject.py:35: [W1648(bad-python3-import), ] Module moved in Python 3
runtime/PLCObject.py:35: [C0411(wrong-import-order), ] standard import "import md5" should be placed before "from six.moves import xrange"
runtime/PLCObject.py:36: [C0411(wrong-import-order), ] standard import "from tempfile import mkstemp" should be placed before "from six.moves import xrange"
runtime/PLCObject.py:37: [C0411(wrong-import-order), ] standard import "import shutil" should be placed before "from six.moves import xrange"
runtime/PLCObject.py:38: [C0411(wrong-import-order), ] standard import "from functools import wraps, partial" should be placed before "from six.moves import xrange"
************* Module runtime.Worker
runtime/Worker.py:12: [W1648(bad-python3-import), ] Module moved in Python 3
************* Module runtime.spawn_subprocess
runtime/spawn_subprocess.py:125: [C0325(superfluous-parens), ] Unnecessary parens after 'print' keyword
runtime/spawn_subprocess.py:130: [C0325(superfluous-parens), ] Unnecessary parens after 'print' keyword
runtime/spawn_subprocess.py:125: [E1601(print-statement), ] print statement used
runtime/spawn_subprocess.py:130: [E1601(print-statement), ] print statement used
************* Module controls.IDBrowser
controls/IDBrowser.py:101: [C0330(bad-continuation), ] Wrong continued indentation (remove 5 spaces).
if self.isManager
| ^
controls/IDBrowser.py:102: [C0330(bad-continuation), ] Wrong continued indentation (remove 5 spaces).
else dv.DATAVIEW_CELL_INERT),
| ^
************* Module Beremiz_service
Beremiz_service.py:34: [W0611(unused-import), ] Unused import __builtin__
1351
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
     1
<?xml version="1.0"?>
1950
752ec68da94d GetPouInstanceTagName optimized with XSLTModelQuery.
Edouard Tisserant
parents: 1936
diff changeset
     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="beremiz" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" extension-element-prefixes="ns" version="1.0" exclude-result-prefixes="ns">
1351
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
     3
  <xsl:output method="xml"/>
1321
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
     4
  <xsl:param name="instance_path"/>
1950
752ec68da94d GetPouInstanceTagName optimized with XSLTModelQuery.
Edouard Tisserant
parents: 1936
diff changeset
     5
  <xsl:variable name="project" select="ns:GetProject()"/>
752ec68da94d GetPouInstanceTagName optimized with XSLTModelQuery.
Edouard Tisserant
parents: 1936
diff changeset
     6
  <xsl:variable name="stdlib" select="ns:GetStdLibs()"/>
752ec68da94d GetPouInstanceTagName optimized with XSLTModelQuery.
Edouard Tisserant
parents: 1936
diff changeset
     7
  <xsl:variable name="extensions" select="ns:GetExtensions()"/>
752ec68da94d GetPouInstanceTagName optimized with XSLTModelQuery.
Edouard Tisserant
parents: 1936
diff changeset
     8
  <xsl:variable name="all_types" select="($project | $stdlib | $extensions)/ppx:types"/>
1321
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">
1351
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    47
          <xsl:call-template name="element_name">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    48
            <xsl:with-param name="path" select="$element_path"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    49
          </xsl:call-template>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    50
        </xsl:variable>
1321
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>
1351
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    60
        <xsl:value-of select="ns:ConfigTagName(@name)"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    61
      </xsl:otherwise>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    62
    </xsl:choose>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    63
  </xsl:template>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    64
  <xsl:template match="ppx:resource">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    65
    <xsl:param name="element_path"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    66
    <xsl:choose>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    67
      <xsl:when test="$element_path!=''">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    68
        <xsl:variable name="child_name">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    69
          <xsl:call-template name="element_name">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    70
            <xsl:with-param name="path">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    71
              <xsl:value-of select="$element_path"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    72
            </xsl:with-param>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    73
          </xsl:call-template>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    74
        </xsl:variable>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    75
        <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
    76
          <xsl:with-param name="element_path">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    77
            <xsl:call-template name="next_path">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    78
              <xsl:with-param name="path" select="$element_path"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    79
            </xsl:call-template>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    80
          </xsl:with-param>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    81
        </xsl:apply-templates>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    82
      </xsl:when>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    83
      <xsl:otherwise>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    84
        <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
    85
      </xsl:otherwise>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    86
    </xsl:choose>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    87
  </xsl:template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    88
  <xsl:template match="ppx:pouInstance">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    89
    <xsl:param name="element_path"/>
1351
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    90
    <xsl:variable name="type_name">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    91
      <xsl:value-of select="@typeName"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    92
    </xsl:variable>
1950
752ec68da94d GetPouInstanceTagName optimized with XSLTModelQuery.
Edouard Tisserant
parents: 1936
diff changeset
    93
    <xsl:apply-templates select="$all_types/ppx:pous/ppx:pou[@name=$type_name] |                  $all_types/ppx:dataTypes/ppx:dataType[@name=$type_name]">
1351
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    94
      <xsl:with-param name="element_path" select="$element_path"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    95
    </xsl:apply-templates>
1321
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:pou">
1351
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    98
    <xsl:param name="element_path"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
    99
    <xsl:choose>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   100
      <xsl:when test="$element_path!=''">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   101
        <xsl:variable name="child_name">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   102
          <xsl:call-template name="element_name">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   103
            <xsl:with-param name="path" select="$element_path"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   104
          </xsl:call-template>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   105
        </xsl:variable>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   106
        <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
   107
          <xsl:with-param name="element_path">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   108
            <xsl:call-template name="next_path">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   109
              <xsl:with-param name="path" select="$element_path"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   110
            </xsl:call-template>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   111
          </xsl:with-param>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   112
        </xsl:apply-templates>
1936
b85b13b1c2ec YSLT auto indent trick is useless here, added yslt_noindent.yml2, regenerated XSLT files
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1351
diff changeset
   113
        <xsl:apply-templates select="ppx:actions/ppx:action[@name=$child_name] | ppx:transitions/ppx:transition[@name=$child_name]"/>
1351
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   114
      </xsl:when>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   115
      <xsl:otherwise>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   116
        <xsl:variable name="name">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   117
          <xsl:value-of select="@name"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   118
        </xsl:variable>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   119
        <xsl:value-of select="ns:PouTagName($name)"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   120
      </xsl:otherwise>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   121
    </xsl:choose>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   122
  </xsl:template>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   123
  <xsl:template match="ppx:action">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   124
    <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
   125
  </xsl:template>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   126
  <xsl:template match="ppx:transition">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   127
    <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
   128
  </xsl:template>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   129
  <xsl:template match="ppx:dataType">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   130
    <xsl:param name="element_path"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   131
    <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
   132
      <xsl:with-param name="element_path" select="$element_path"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   133
    </xsl:apply-templates>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   134
  </xsl:template>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   135
  <xsl:template match="ppx:derived">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   136
    <xsl:param name="element_path"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   137
    <xsl:variable name="type_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>
1950
752ec68da94d GetPouInstanceTagName optimized with XSLTModelQuery.
Edouard Tisserant
parents: 1936
diff changeset
   140
    <xsl:apply-templates select="$all_types/ppx:pous/ppx:pou[@name=$type_name] |                  $all_types/ppx:dataTypes/ppx:dataType[@name=$type_name]">
1351
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   141
      <xsl:with-param name="element_path" select="$element_path"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   142
    </xsl:apply-templates>
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:array">
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   145
    <xsl:param name="element_path"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   146
    <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
   147
      <xsl:with-param name="element_path" select="$element_path"/>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   148
    </xsl:apply-templates>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   149
  </xsl:template>
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   150
  <xsl:template match="ppx:struct">
1321
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:variable name="child_name">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   153
      <xsl:call-template name="element_name">
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   154
        <xsl:with-param name="path" select="$element_path"/>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   155
      </xsl:call-template>
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   156
    </xsl:variable>
1351
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   157
    <xsl:apply-templates select="ppx:variable[@name=$child_name]/ppx:type/*[self::ppx:derived or self::ppx:struct or self::ppx:array]">
1326
e2c11668addf Fixed instance type tagname computing xslt stylesheet
Laurent Bessard
parents: 1321
diff changeset
   158
      <xsl:with-param name="element_path">
e2c11668addf Fixed instance type tagname computing xslt stylesheet
Laurent Bessard
parents: 1321
diff changeset
   159
        <xsl:call-template name="next_path">
e2c11668addf Fixed instance type tagname computing xslt stylesheet
Laurent Bessard
parents: 1321
diff changeset
   160
          <xsl:with-param name="path" select="$element_path"/>
e2c11668addf Fixed instance type tagname computing xslt stylesheet
Laurent Bessard
parents: 1321
diff changeset
   161
        </xsl:call-template>
e2c11668addf Fixed instance type tagname computing xslt stylesheet
Laurent Bessard
parents: 1321
diff changeset
   162
      </xsl:with-param>
e2c11668addf Fixed instance type tagname computing xslt stylesheet
Laurent Bessard
parents: 1321
diff changeset
   163
    </xsl:apply-templates>
1321
83f41ea00b97 Replaced old pou instance type tagname computing by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   164
  </xsl:template>
1351
a546a63ce1bf Fixed pou tagname of instance path computing stylesheet
Laurent Bessard
parents: 1326
diff changeset
   165
</xsl:stylesheet>