etherlab/entries_list.ysl2
author Edouard Tisserant <edouard.tisserant@gmail.com>
Tue, 22 Dec 2020 18:05:05 +0100
changeset 2711 ecfb59e4ecb0
parent 2641 c9deff128c37
permissions -rw-r--r--
Fix missing import, consequence of bad resolution of conflicting hg graft of f0a822ef9fa0 into d15a997859b1
2165
02a2b5dee5e3 Merged GPL + LGPL v2 or later EtherCAT extension. Fixed headers and copyright notice.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2162
diff changeset
     1
/*
02a2b5dee5e3 Merged GPL + LGPL v2 or later EtherCAT extension. Fixed headers and copyright notice.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2162
diff changeset
     2
02a2b5dee5e3 Merged GPL + LGPL v2 or later EtherCAT extension. Fixed headers and copyright notice.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2162
diff changeset
     3
Stylesheet used to list EtherCat dictionnary entries.
02a2b5dee5e3 Merged GPL + LGPL v2 or later EtherCAT extension. Fixed headers and copyright notice.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2162
diff changeset
     4
02a2b5dee5e3 Merged GPL + LGPL v2 or later EtherCAT extension. Fixed headers and copyright notice.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2162
diff changeset
     5
Copyright (C) 2011-2014: Laurent BESSARD
02a2b5dee5e3 Merged GPL + LGPL v2 or later EtherCAT extension. Fixed headers and copyright notice.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2162
diff changeset
     6
02a2b5dee5e3 Merged GPL + LGPL v2 or later EtherCAT extension. Fixed headers and copyright notice.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2162
diff changeset
     7
Distributed under the terms of the GNU Lesser General Public License as
02a2b5dee5e3 Merged GPL + LGPL v2 or later EtherCAT extension. Fixed headers and copyright notice.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2162
diff changeset
     8
published by the Free Software Foundation; either version 2 of the License, or
02a2b5dee5e3 Merged GPL + LGPL v2 or later EtherCAT extension. Fixed headers and copyright notice.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2162
diff changeset
     9
(at your option) any later version.
02a2b5dee5e3 Merged GPL + LGPL v2 or later EtherCAT extension. Fixed headers and copyright notice.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2162
diff changeset
    10
02a2b5dee5e3 Merged GPL + LGPL v2 or later EtherCAT extension. Fixed headers and copyright notice.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2162
diff changeset
    11
See COPYING file for copyrights details.
02a2b5dee5e3 Merged GPL + LGPL v2 or later EtherCAT extension. Fixed headers and copyright notice.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2162
diff changeset
    12
02a2b5dee5e3 Merged GPL + LGPL v2 or later EtherCAT extension. Fixed headers and copyright notice.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2162
diff changeset
    13
*/
02a2b5dee5e3 Merged GPL + LGPL v2 or later EtherCAT extension. Fixed headers and copyright notice.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2162
diff changeset
    14
2162
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    15
include yslt.yml2
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    16
estylesheet xmlns:ns="entries_list_ns" 
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    17
            extension-element-prefixes="ns" 
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    18
            exclude-result-prefixes="ns" {
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    19
    
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    20
    param "min_index";
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    21
    param "max_index";
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    22
    
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    23
    template "text()";
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    24
    
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    25
    template "Device" {
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    26
        apply "Profile/Dictionary/Objects/Object";
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    27
        foreach "RxPdo" {
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    28
            call "pdo_entries" with "direction", "'Receive'";
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    29
        }
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    30
        foreach "TxPdo" {
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    31
            call "pdo_entries" with "direction", "'Transmit'";
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    32
        }
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    33
    }
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    34
    
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    35
    template "Object" {
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    36
        variable "index" > «ns:HexDecValue(Index/text())»
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    37
        variable "entry_name" > «ns:EntryName(Name)»
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    38
        choose {
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    39
            when "$index >= $min_index and $index <= $max_index" {
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    40
                variable "datatype_name" > «Type/text()»
2641
c9deff128c37 EtherCat master plugin : commit changes recovered from KOSMOS 2018 installer, unkown author(s).
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2165
diff changeset
    41
                variable "default_value" > «Info/DefaultData/text()»
2162
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    42
                choose {
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    43
                    when "ancestor::Dictionary/child::DataTypes/DataType[Name/text()=$datatype_name][SubItem]" {
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    44
                        apply "ancestor::Dictionary/child::DataTypes/DataType[Name/text()=$datatype_name][SubItem]" {
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    45
                            with "index" > «$index»
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    46
                            with "entry_name" > «$entry_name»
2641
c9deff128c37 EtherCat master plugin : commit changes recovered from KOSMOS 2018 installer, unkown author(s).
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2165
diff changeset
    47
                            with "sub_default_value" > «Info/SubItem/Info/DefaultData/text()»
2162
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    48
                        }
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    49
                    }
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    50
                    otherwise {
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    51
                        variable "subindex" > 0
2641
c9deff128c37 EtherCat master plugin : commit changes recovered from KOSMOS 2018 installer, unkown author(s).
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2165
diff changeset
    52
                        variable "sub_entry_flag" > 0
2162
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    53
                        variable "entry" {
2641
c9deff128c37 EtherCat master plugin : commit changes recovered from KOSMOS 2018 installer, unkown author(s).
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2165
diff changeset
    54
                            > «ns:AddEntry($index, $subindex, $entry_name, $datatype_name, BitSize/text(), Flags/Access/text(), Flags/PdoMapping/text(), $default_value, $sub_entry_flag)»
2162
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    55
                        }
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    56
                    }
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    57
                }
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    58
            }
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    59
        }
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    60
    }
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    61
    
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    62
    template "DataType" {
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    63
        param "index";
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    64
        param "entry_name";
2641
c9deff128c37 EtherCat master plugin : commit changes recovered from KOSMOS 2018 installer, unkown author(s).
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2165
diff changeset
    65
        param "sub_default_value"
2162
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    66
        foreach "SubItem" {
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    67
            variable "subindex" > «ns:HexDecValue(SubIdx/text())»
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    68
            variable "subentry_name" > «$entry_name» - «ns:EntryName(DisplayName, Name/text())»
2641
c9deff128c37 EtherCat master plugin : commit changes recovered from KOSMOS 2018 installer, unkown author(s).
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2165
diff changeset
    69
            variable "sub_entry_flag" > 1
2162
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    70
            variable "entry" {
2641
c9deff128c37 EtherCat master plugin : commit changes recovered from KOSMOS 2018 installer, unkown author(s).
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2165
diff changeset
    71
                > «ns:AddEntry($index, $subindex, $subentry_name, Type/text(), BitSize/text(), Flags/Access/text(), Flags/PdoMapping/text(), $sub_default_value, $sub_entry_flag)»
2162
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    72
            }
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    73
        }
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    74
    }
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    75
    
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    76
    function "pdo_entries" {
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    77
        param "direction";
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    78
        variable "pdo_index" > «ns:HexDecValue(Index/text())»
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    79
        variable "pdo_name" > «ns:EntryName(Name)»
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    80
        foreach "Entry" {
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    81
            variable "index" > «ns:HexDecValue(Index/text())»
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    82
            choose {
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    83
                when "$index >= $min_index and $index <= $max_index" {
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    84
                    variable "subindex" > «ns:HexDecValue(SubIndex/text())»
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    85
                    variable "subentry_name" > «ns:EntryName(Name)»
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    86
                    variable "access" {
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    87
                        choose {
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    88
                            when "$direction='Transmit'" > ro
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    89
                            otherwise > wo
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    90
                        }
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    91
                    }
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    92
                    variable "pdo_mapping" {
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    93
                        choose {
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    94
                            when "$direction='Transmit'" > T
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    95
                            otherwise > R
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    96
                        }
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    97
                    }
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    98
                    variable "entry" {
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
    99
                        > «ns:AddEntry($index, $subindex, $subentry_name, DataType/text(), BitLen/text(), $access, $pdo_mapping, $pdo_index, $pdo_name, $direction)»
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
   100
                    }
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
   101
                }
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
   102
            }
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
   103
        }
43ab74687f45 Fixed xslt stylesheet for extracting entries defined in module, rewiting xslt stylesheet to yslt
Laurent Bessard
parents:
diff changeset
   104
    }
2165
02a2b5dee5e3 Merged GPL + LGPL v2 or later EtherCAT extension. Fixed headers and copyright notice.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2162
diff changeset
   105
}