Project

General

Profile

1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet version="1.0" 
3
  xmlns:xs="http://www.w3.org/2001/XMLSchema" 
4
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
5
  xmlns:out="http://www.w3.org/dummyXSL" >
6

    
7
<!--
8
Description: Generate the component register from the config XML schema.
9
Author:      Mike Adair
10
Licence:     LGPL as per: http://www.gnu.org/copyleft/lesser.html
11

    
12
$Id$
13
-->
14

    
15
  <xsl:output method="xml" encoding="utf-8" indent="yes"/>
16
  
17
  <xsl:param name="widgetId"/>
18
  <xsl:param name="listType">modelsType</xsl:param>
19
  <xsl:param name="subType"/>
20
  
21
  <xsl:variable name="docRoot" select="/xs:schema"/>
22

    
23
	<xsl:template match="/xs:schema">
24
    <dl>
25
      <xsl:for-each select="xs:complexType[@name=$listType]/xs:choice/*">
26
        <xsl:variable name="typeName" select="substring-after(@type,':')"/>
27
        <xsl:variable name="typeDef" select="$docRoot/xs:complexType[@name=$typeName]"/>
28
        <xsl:if test="string-length($subType)=0 or $typeDef/xs:complexContent/xs:extension/@base=$subType">
29
          <dt><a href="javascript:config.objects.{$widgetId}.showDetails('{$typeName}')"><xsl:value-of select="@name"/></a></dt>
30
          <dd><xsl:value-of select="$typeDef/xs:annotation/xs:documentation"/></dd>
31
        </xsl:if>
32
      </xsl:for-each>
33
    </dl>
34
	</xsl:template>
35
  
36
  <xsl:template match="text()|@*"/>
37

    
38
</xsl:stylesheet>
(3-3/9)