|
|
@@ -0,0 +1,189 @@
|
|
|
+<?xml version="1.0" encoding="UTF-8"?>
|
|
|
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
|
+ version="1.0">
|
|
|
+ <xsl:template match="content">
|
|
|
+ <content>
|
|
|
+
|
|
|
+ <!-- form -->
|
|
|
+ <xsl:for-each select="form">
|
|
|
+ <items>
|
|
|
+ <type>form</type>
|
|
|
+ <config>
|
|
|
+ <!-- TODO -->
|
|
|
+ <fieldStyle />
|
|
|
+ <!-- TODO -->
|
|
|
+ <valueStyle />
|
|
|
+ <columns>
|
|
|
+ <xsl:value-of select="@columns" />
|
|
|
+ </columns>
|
|
|
+ <xsl:for-each select="field">
|
|
|
+ <data>
|
|
|
+ <field>
|
|
|
+ <xsl:value-of select="@name" />
|
|
|
+ </field>
|
|
|
+ <value>
|
|
|
+ <xsl:value-of select="@value" />
|
|
|
+ </value>
|
|
|
+ </data>
|
|
|
+ </xsl:for-each>
|
|
|
+ </config>
|
|
|
+ <xsl:call-template name="layout" />
|
|
|
+ </items>
|
|
|
+ </xsl:for-each>
|
|
|
+
|
|
|
+ <!-- grid (table) -->
|
|
|
+ <xsl:for-each select="grid">
|
|
|
+ <items>
|
|
|
+ <type>table</type>
|
|
|
+ <config>
|
|
|
+ <title>
|
|
|
+ <xsl:value-of select="@title" />
|
|
|
+ </title>
|
|
|
+ <cls>
|
|
|
+ <xsl:value-of select="@allcls" />
|
|
|
+ </cls>
|
|
|
+ <render>
|
|
|
+ <xsl:value-of select="@allrender" />
|
|
|
+ </render>
|
|
|
+ <xsl:for-each select="field">
|
|
|
+ <columns>
|
|
|
+ <title>
|
|
|
+ <xsl:value-of select="@name" />
|
|
|
+ </title>
|
|
|
+ <width>
|
|
|
+ <xsl:value-of select="@width" />
|
|
|
+ </width>
|
|
|
+ <sort>
|
|
|
+ <xsl:value-of select="@sort" />
|
|
|
+ </sort>
|
|
|
+ <cls>
|
|
|
+ <xsl:value-of select="@cls" />
|
|
|
+ </cls>
|
|
|
+ <dataIndex>
|
|
|
+ <xsl:value-of select="@dataindex" />
|
|
|
+ </dataIndex>
|
|
|
+ <render>
|
|
|
+ <xsl:value-of select="@rendername" />
|
|
|
+ </render>
|
|
|
+ </columns>
|
|
|
+ </xsl:for-each>
|
|
|
+ <xsl:copy-of select="data" />
|
|
|
+ </config>
|
|
|
+ <xsl:call-template name="layout" />
|
|
|
+ </items>
|
|
|
+ </xsl:for-each>
|
|
|
+
|
|
|
+ <!-- bar -->
|
|
|
+ <xsl:for-each select="bar">
|
|
|
+ <xsl:call-template name="barOrLine">
|
|
|
+ <xsl:with-param name="type">
|
|
|
+ <!-- 不直接输出字符串,是因为有空格的问题 -->
|
|
|
+ <xsl:value-of select="concat('bar')" />
|
|
|
+ </xsl:with-param>
|
|
|
+ </xsl:call-template>
|
|
|
+ </xsl:for-each>
|
|
|
+
|
|
|
+ <!-- line -->
|
|
|
+ <xsl:for-each select="line">
|
|
|
+ <xsl:call-template name="barOrLine">
|
|
|
+ <xsl:with-param name="type">
|
|
|
+ <!-- 不直接输出字符串,是因为有空格的问题 -->
|
|
|
+ <xsl:value-of select="concat('line')" />
|
|
|
+ </xsl:with-param>
|
|
|
+ </xsl:call-template>
|
|
|
+ </xsl:for-each>
|
|
|
+
|
|
|
+ <!-- pie -->
|
|
|
+ <xsl:for-each select="pie">
|
|
|
+ <items>
|
|
|
+ <type>pie</type>
|
|
|
+ <config>
|
|
|
+ <title>
|
|
|
+ <xsl:value-of select="@maintitle" />
|
|
|
+ </title>
|
|
|
+ <subtitle>
|
|
|
+ <xsl:value-of select="@subtitle" />
|
|
|
+ </subtitle>
|
|
|
+ <xsl:for-each select="series">
|
|
|
+ <series>
|
|
|
+ <name>
|
|
|
+ <xsl:value-of select="@name" />
|
|
|
+ </name>
|
|
|
+ <data>
|
|
|
+ <xsl:value-of select="@data" />
|
|
|
+ </data>
|
|
|
+ </series>
|
|
|
+ </xsl:for-each>
|
|
|
+ </config>
|
|
|
+ <xsl:call-template name="layout" />
|
|
|
+ </items>
|
|
|
+ </xsl:for-each>
|
|
|
+ </content>
|
|
|
+ </xsl:template>
|
|
|
+
|
|
|
+ <!-- remove table's name in field -->
|
|
|
+ <xsl:template name="barOrLine">
|
|
|
+ <xsl:param name="type" />
|
|
|
+ <items>
|
|
|
+ <type>
|
|
|
+ <xsl:value-of select="$type" />
|
|
|
+ </type>
|
|
|
+ <config>
|
|
|
+ <title>
|
|
|
+ <xsl:value-of select="@maintitle" />
|
|
|
+ </title>
|
|
|
+ <subtitle>
|
|
|
+ <xsl:value-of select="@subtitle" />
|
|
|
+ </subtitle>
|
|
|
+ <xtitle>
|
|
|
+ <xsl:value-of select="@xtitle" />
|
|
|
+ </xtitle>
|
|
|
+ <xtype>
|
|
|
+ <xsl:value-of select="@xtype" />
|
|
|
+ </xtype>
|
|
|
+ <xfields>
|
|
|
+ <xsl:value-of select="@xfields" />
|
|
|
+ </xfields>
|
|
|
+ <ytitle>
|
|
|
+ <xsl:value-of select="@ytitle" />
|
|
|
+ </ytitle>
|
|
|
+ <ytype>
|
|
|
+ <xsl:value-of select="@ytype" />
|
|
|
+ </ytype>
|
|
|
+ <!-- TODO -->
|
|
|
+ <yfields />
|
|
|
+ <xsl:for-each select="series">
|
|
|
+ <series>
|
|
|
+ <name>
|
|
|
+ <xsl:value-of select="@name" />
|
|
|
+ </name>
|
|
|
+ <xsl:for-each select="data">
|
|
|
+ <data>
|
|
|
+ <xsl:value-of select="." />
|
|
|
+ </data>
|
|
|
+ </xsl:for-each>
|
|
|
+ </series>
|
|
|
+ </xsl:for-each>
|
|
|
+ </config>
|
|
|
+ <xsl:call-template name="layout" />
|
|
|
+ </items>
|
|
|
+ </xsl:template>
|
|
|
+
|
|
|
+ <!-- remove table's name in field -->
|
|
|
+ <xsl:template name="layout">
|
|
|
+ <layout>
|
|
|
+ <x>
|
|
|
+ <xsl:value-of select="@x" />
|
|
|
+ </x>
|
|
|
+ <y>
|
|
|
+ <xsl:value-of select="@y" />
|
|
|
+ </y>
|
|
|
+ <w>
|
|
|
+ <xsl:value-of select="@width" />
|
|
|
+ </w>
|
|
|
+ <h>
|
|
|
+ <xsl:value-of select="@height" />
|
|
|
+ </h>
|
|
|
+ </layout>
|
|
|
+ </xsl:template>
|
|
|
+</xsl:stylesheet>
|