summaryrefslogtreecommitdiff
path: root/ebus-xml/transform/ebus.txt.xslt
blob: dda1e33b443a4566ff0f00c0e563cfb2fa7c32f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?xml version="1.0" encoding="utf8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- TODO: padding -->
  <xsl:output method="text" />
  <xsl:template match="/">
=== Ebus Geräte

Adresse | Gerät | Typ

      <xsl:for-each select="ebus/devices/device">
            <xsl:value-of select="@address"/>
            <xsl:text>|</xsl:text>
            <xsl:value-of select="text()"/>
            <xsl:text>|</xsl:text>
            <xsl:value-of select="@type"/>
            <xsl:text>
</xsl:text> 
      </xsl:for-each>

=== Ebus Pakete

Primary Command | Secondary Command | Name | Description
     ---- offset | typ | name | description
      <xsl:for-each select="ebus/packets/packet">
        <xsl:value-of select="@primary"/>
        <xsl:text>|</xsl:text>
        <xsl:value-of select="@secondary"/>
        <xsl:text>|</xsl:text>
        <xsl:value-of select="@name"/>
        <xsl:text>|</xsl:text>
        <xsl:value-of select="@description"/>

        <xsl:for-each select="fields/*">
          <xsl:value-of select="@offset"/>
          <xsl:text>|</xsl:text>
          <xsl:value-of select="name()"/>
          <xsl:text>|</xsl:text>
          <xsl:value-of select="@name"/>
          <xsl:text>|</xsl:text>
	  <xsl:value-of select="text()"/>
          <xsl:text>
          </xsl:text>
        </xsl:for-each>
        <xsl:text>
        </xsl:text>      
      </xsl:for-each>
  </xsl:template>
</xsl:stylesheet>