1 <?xml version="1.0"?> |
1 <?xml version="1.0"?> |
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" xmlns:regexp="http://exslt.org/regular-expressions" xmlns:str="http://exslt.org/strings" xmlns:func="http://exslt.org/functions" xmlns:svg="http://www.w3.org/2000/svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.0" extension-element-prefixes="ns func exsl regexp str dyn" exclude-result-prefixes="ns func exsl regexp str dyn svg inkscape"> |
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" xmlns:regexp="http://exslt.org/regular-expressions" xmlns:str="http://exslt.org/strings" xmlns:func="http://exslt.org/functions" xmlns:svg="http://www.w3.org/2000/svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.0" extension-element-prefixes="ns func exsl regexp str dyn" exclude-result-prefixes="ns func exsl regexp str dyn svg inkscape"> |
3 <xsl:output method="xml"/> |
3 <xsl:output method="xml"/> |
4 <xsl:variable name="indexed_hmitree" select="/.."/> |
4 <xsl:variable name="indexed_hmitree" select="/.."/> |
5 <xsl:variable name="pathregex" select="'^([^\[,]+)(\[[^\]]+\])?([-.\d,]*)$'"/> |
5 <xsl:variable name="pathregex" select="'^([^\[,]+)(\[[^\]]+\])?([-.\d,]*)$'"/> |
|
6 <xsl:variable name="newline"> |
|
7 <xsl:text> |
|
8 </xsl:text> |
|
9 </xsl:variable> |
|
10 <xsl:variable name="twonewlines" select="concat($newline,$newline)"/> |
6 <xsl:template mode="parselabel" match="*"> |
11 <xsl:template mode="parselabel" match="*"> |
7 <xsl:variable name="label" select="@inkscape:label"/> |
12 <xsl:variable name="part" select="@inkscape:label"/> |
|
13 <xsl:variable name="desc" select="svg:desc"/> |
|
14 <xsl:variable name="len" select="string-length($part)"/> |
|
15 <xsl:variable name="has_continuation" select="substring($part,$len,1)='\'"/> |
|
16 <xsl:variable name="label"> |
|
17 <xsl:choose> |
|
18 <xsl:when test="$has_continuation"> |
|
19 <xsl:variable name="_continuation" select="substring-before($desc, $twonewlines)"/> |
|
20 <xsl:variable name="continuation"> |
|
21 <xsl:choose> |
|
22 <xsl:when test="$_continuation"> |
|
23 <xsl:value-of select="$_continuation"/> |
|
24 </xsl:when> |
|
25 <xsl:otherwise> |
|
26 <xsl:value-of select="$desc"/> |
|
27 </xsl:otherwise> |
|
28 </xsl:choose> |
|
29 </xsl:variable> |
|
30 <xsl:value-of select="concat(substring($part,1,$len - 1),translate($continuation,$newline,''))"/> |
|
31 </xsl:when> |
|
32 <xsl:otherwise> |
|
33 <xsl:value-of select="$part"/> |
|
34 </xsl:otherwise> |
|
35 </xsl:choose> |
|
36 </xsl:variable> |
8 <xsl:variable name="id" select="@id"/> |
37 <xsl:variable name="id" select="@id"/> |
9 <xsl:variable name="description" select="substring-after($label,'HMI:')"/> |
38 <xsl:variable name="description" select="substring-after($label,'HMI:')"/> |
10 <xsl:variable name="_args" select="substring-before($description,'@')"/> |
39 <xsl:variable name="_args" select="substring-before($description,'@')"/> |
11 <xsl:variable name="args"> |
40 <xsl:variable name="args"> |
12 <xsl:choose> |
41 <xsl:choose> |
146 </xsl:choose> |
175 </xsl:choose> |
147 </xsl:if> |
176 </xsl:if> |
148 </path> |
177 </path> |
149 </xsl:if> |
178 </xsl:if> |
150 </xsl:for-each> |
179 </xsl:for-each> |
151 <xsl:if test="svg:desc"> |
180 <xsl:choose> |
152 <desc> |
181 <xsl:when test="$has_continuation"> |
153 <xsl:value-of select="svg:desc/text()"/> |
182 <xsl:variable name="_continuation" select="substring-after($desc, $twonewlines)"/> |
154 </desc> |
183 <xsl:if test="$_continuation"> |
155 </xsl:if> |
184 <desc> |
|
185 <xsl:value-of select="$_continuation"/> |
|
186 </desc> |
|
187 </xsl:if> |
|
188 </xsl:when> |
|
189 <xsl:otherwise> |
|
190 <xsl:if test="$desc"> |
|
191 <desc> |
|
192 <xsl:value-of select="$desc/text()"/> |
|
193 </desc> |
|
194 </xsl:if> |
|
195 </xsl:otherwise> |
|
196 </xsl:choose> |
156 </widget> |
197 </widget> |
157 </xsl:if> |
198 </xsl:if> |
158 </xsl:template> |
199 </xsl:template> |
159 <xsl:template mode="genlabel" match="arg"> |
200 <xsl:template mode="genlabel" match="arg"> |
160 <xsl:text>:</xsl:text> |
201 <xsl:text>:</xsl:text> |