/alps/pcitool

To get this branch, use:
bzr branch http://suren.me/webbzr/alps/pcitool

« back to all changes in this revision

Viewing changes to misc/xml/format.xsl

  • Committer: Suren A. Chilingaryan
  • Date: 2015-09-24 02:28:45 UTC
  • mfrom: (305.1.19 views)
  • Revision ID: csa@suren.me-20150924022845-p7hc8lh8v0q48g0r
Finalyze XML support and provide initial support for views (only descriptions so far)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0"?>
 
2
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
 
3
  <xsl:template match="register|field">
 
4
    <xsl:if test="local-name() = 'field'">
 
5
      <xsl:value-of select="preceding-sibling::text()"/>
 
6
    </xsl:if>
 
7
 
 
8
    <xsl:element name="{local-name()}">
 
9
      <xsl:apply-templates select="@*"/>
 
10
      <xsl:for-each select="view">
 
11
        <xsl:copy>
 
12
          <xsl:apply-templates select="@*"/>
 
13
        </xsl:copy>
 
14
      </xsl:for-each>
 
15
      <xsl:apply-templates select="field"/>
 
16
      <xsl:if test="field">
 
17
        <xsl:value-of select="text()[last()]"/>
 
18
      </xsl:if>
 
19
    </xsl:element>
 
20
  </xsl:template>
 
21
 
 
22
  <xsl:template match="//model/bank|//model/transform|//model/enum|//model/unit">
 
23
    <xsl:value-of select="preceding-sibling::text()"/>
 
24
    <xsl:copy>
 
25
      <xsl:apply-templates select="@*|node()"/>
 
26
    </xsl:copy>
 
27
  </xsl:template>
 
28
 
 
29
  <xsl:template match="model">
 
30
    <xsl:copy>
 
31
      <xsl:apply-templates select="bank"/>
 
32
      <xsl:apply-templates select="transform"/>
 
33
      <xsl:apply-templates select="enum"/>
 
34
      <xsl:apply-templates select="unit"/>
 
35
      <xsl:value-of select="text()[last()]"/>
 
36
    </xsl:copy>
 
37
  </xsl:template>
 
38
 
 
39
  <xsl:template match="@*|node()">
 
40
    <xsl:copy>
 
41
      <xsl:apply-templates select="@*|node()"/>
 
42
    </xsl:copy>
 
43
  </xsl:template>
 
44
</xsl:stylesheet>