158 <xsl:value-of select="$parentpath"/> |
158 <xsl:value-of select="$parentpath"/> |
159 </xsl:with-param> |
159 </xsl:with-param> |
160 </xsl:apply-templates> |
160 </xsl:apply-templates> |
161 </xsl:template> |
161 </xsl:template> |
162 <xsl:variable name="pathregex" select="'^([^\[,]+)(\[[^\]]+\])?([-.\d,]*)$'"/> |
162 <xsl:variable name="pathregex" select="'^([^\[,]+)(\[[^\]]+\])?([-.\d,]*)$'"/> |
|
163 <xsl:variable name="newline"> |
|
164 <xsl:text> |
|
165 </xsl:text> |
|
166 </xsl:variable> |
|
167 <xsl:variable name="twonewlines" select="concat($newline,$newline)"/> |
163 <xsl:template mode="parselabel" match="*"> |
168 <xsl:template mode="parselabel" match="*"> |
164 <xsl:variable name="label" select="@inkscape:label"/> |
169 <xsl:variable name="part" select="@inkscape:label"/> |
|
170 <xsl:variable name="desc" select="svg:desc"/> |
|
171 <xsl:variable name="len" select="string-length($part)"/> |
|
172 <xsl:variable name="has_continuation" select="substring($part,$len,1)='\'"/> |
|
173 <xsl:variable name="label"> |
|
174 <xsl:choose> |
|
175 <xsl:when test="$has_continuation"> |
|
176 <xsl:variable name="_continuation" select="substring-before($desc, $twonewlines)"/> |
|
177 <xsl:variable name="continuation"> |
|
178 <xsl:choose> |
|
179 <xsl:when test="$_continuation"> |
|
180 <xsl:value-of select="$_continuation"/> |
|
181 </xsl:when> |
|
182 <xsl:otherwise> |
|
183 <xsl:value-of select="$desc"/> |
|
184 </xsl:otherwise> |
|
185 </xsl:choose> |
|
186 </xsl:variable> |
|
187 <xsl:value-of select="concat(substring($part,1,$len - 1),translate($continuation,$newline,''))"/> |
|
188 </xsl:when> |
|
189 <xsl:otherwise> |
|
190 <xsl:value-of select="$part"/> |
|
191 </xsl:otherwise> |
|
192 </xsl:choose> |
|
193 </xsl:variable> |
165 <xsl:variable name="id" select="@id"/> |
194 <xsl:variable name="id" select="@id"/> |
166 <xsl:variable name="description" select="substring-after($label,'HMI:')"/> |
195 <xsl:variable name="description" select="substring-after($label,'HMI:')"/> |
167 <xsl:variable name="_args" select="substring-before($description,'@')"/> |
196 <xsl:variable name="_args" select="substring-before($description,'@')"/> |
168 <xsl:variable name="args"> |
197 <xsl:variable name="args"> |
169 <xsl:choose> |
198 <xsl:choose> |
303 </xsl:choose> |
332 </xsl:choose> |
304 </xsl:if> |
333 </xsl:if> |
305 </path> |
334 </path> |
306 </xsl:if> |
335 </xsl:if> |
307 </xsl:for-each> |
336 </xsl:for-each> |
308 <xsl:if test="svg:desc"> |
337 <xsl:choose> |
309 <desc> |
338 <xsl:when test="$has_continuation"> |
310 <xsl:value-of select="svg:desc/text()"/> |
339 <xsl:variable name="_continuation" select="substring-after($desc, $twonewlines)"/> |
311 </desc> |
340 <xsl:if test="$_continuation"> |
312 </xsl:if> |
341 <desc> |
|
342 <xsl:value-of select="$_continuation"/> |
|
343 </desc> |
|
344 </xsl:if> |
|
345 </xsl:when> |
|
346 <xsl:otherwise> |
|
347 <xsl:if test="$desc"> |
|
348 <desc> |
|
349 <xsl:value-of select="$desc/text()"/> |
|
350 </desc> |
|
351 </xsl:if> |
|
352 </xsl:otherwise> |
|
353 </xsl:choose> |
313 </widget> |
354 </widget> |
314 </xsl:if> |
355 </xsl:if> |
315 </xsl:template> |
356 </xsl:template> |
316 <xsl:template mode="genlabel" match="arg"> |
357 <xsl:template mode="genlabel" match="arg"> |
317 <xsl:text>:</xsl:text> |
358 <xsl:text>:</xsl:text> |
369 <xsl:value-of select="."/> |
410 <xsl:value-of select="."/> |
370 <xsl:text>" </xsl:text> |
411 <xsl:text>" </xsl:text> |
371 </xsl:for-each> |
412 </xsl:for-each> |
372 <xsl:text> |
413 <xsl:text> |
373 </xsl:text> |
414 </xsl:text> |
|
415 <xsl:if test="text()"> |
|
416 <xsl:value-of select="text()"/> |
|
417 <xsl:text> |
|
418 </xsl:text> |
|
419 </xsl:if> |
374 <xsl:apply-templates mode="testtree" select="*"> |
420 <xsl:apply-templates mode="testtree" select="*"> |
375 <xsl:with-param name="indent"> |
421 <xsl:with-param name="indent"> |
376 <xsl:value-of select="concat($indent,'>')"/> |
422 <xsl:value-of select="concat($indent,'>')"/> |
377 </xsl:with-param> |
423 </xsl:with-param> |
378 </xsl:apply-templates> |
424 </xsl:apply-templates> |