-
Notifications
You must be signed in to change notification settings - Fork 1
/
genRadioButton.xsl
78 lines (78 loc) · 2.8 KB
/
genRadioButton.xsl
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes" />
<xsl:template name="groupButtons">
<xsl:param name="count"/>
<xsl:param name="index"/>
<xsl:if test="$index <= $count">
<RadioButton>
<xsl:attribute name="Value">
<xsl:value-of select="following-sibling::row[$index]/td[3]"/>
</xsl:attribute>
<xsl:attribute name="X">
<xsl:value-of select="following-sibling::row[$index]/td[4]"/>
</xsl:attribute>
<xsl:attribute name="Y">
<xsl:value-of select="following-sibling::row[$index]/td[5]"/>
</xsl:attribute>
<xsl:attribute name="Width">
<xsl:value-of select="following-sibling::row[$index]/td[6]"/>
</xsl:attribute>
<xsl:attribute name="Height">
<xsl:value-of select="following-sibling::row[$index]/td[7]"/>
</xsl:attribute>
<xsl:attribute name="Text">!(loc.<xsl:value-of select="substring-before(substring-after(following-sibling::row[$index]/td[8], '##'), '##')" />)</xsl:attribute>
</RadioButton>
<xsl:call-template name="groupButtons">
<xsl:with-param name="count" select="$count"></xsl:with-param>
<xsl:with-param name="index" select="$index + 1"></xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template match="/msi/table[@name='RadioButton']">
<!--Need to be correctly GROUPPED-->
<UI>
<xsl:for-each select="row">
<xsl:if test="preceding-sibling::row[1]/td[1] != td[1]">
<Property>
<xsl:attribute name="Id">
<xsl:value-of select="td[1]" />
</xsl:attribute>
<xsl:value-of select="td[3]" />
</Property>
<RadioButtonGroup>
<xsl:attribute name="Property">
<xsl:value-of select="td[1]" />
</xsl:attribute>
<xsl:value-of select="count(//td[text() = td[1]])"/>
<xsl:for-each select="../td[text() = td[1]]">
<RadioButton>
<xsl:attribute name="Value">
<xsl:value-of select="../td[3]"/>
</xsl:attribute>
<xsl:attribute name="X">
<xsl:value-of select="../td[4]"/>
</xsl:attribute>
<xsl:attribute name="Y">
<xsl:value-of select="../td[5]"/>
</xsl:attribute>
<xsl:attribute name="Width">
<xsl:value-of select="../td[6]"/>
</xsl:attribute>
<xsl:attribute name="Height">
<xsl:value-of select="../td[7]"/>
</xsl:attribute>
<xsl:attribute name="Text">!(loc.<xsl:value-of select="substring-before(substring-after(../td[8], '##'), '##')" />)</xsl:attribute>
</RadioButton>
</xsl:for-each>
<!--
<xsl:call-template name="groupButtons">
<xsl:with-param name="count" select="count(td['text()=td[1]'])"/>
<xsl:with-param name="index" select="1"/>
</xsl:call-template>-->
</RadioButtonGroup>
</xsl:if>
</xsl:for-each>
</UI>
</xsl:template>
</xsl:stylesheet>