annotate xslt/generator.csharp.xsl @ 6:1f4009d4afb6

working on model to csharp transform
author cin
date Mon, 05 Mar 2018 10:37:47 +0300
parents 6f67d3a6b950
children 3fe157be5141
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
1 <?xml version="1.0" encoding="UTF-8"?>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
2 <xsl:stylesheet version="1.0"
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:m="http://implab.org/schemas/data-model.v1.xsd"
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
4 xmlns:clr="http://implab.org/schemas/data-model/dotnet.v1.xsd"
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
5 xmlns:cs="http://implab.org/schemas/code-dom/csharp.v1.xsd" xmlns:sql="http://implab.org/schemas/data-model/sql.v1.xsd"
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
6 xmlns:t="http://implab.org/schemas/temp" xmlns:exsl="http://exslt.org/common"
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
7 exclude-result-prefixes="clr m xsl exsl sql">
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
8 <xsl:import href="model.xsl"/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
9
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
10 <xsl:output method="xml" indent="yes" />
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
11
3
437127ab6a12 non-working version
cin
parents: 2
diff changeset
12 <!-- generate code for primary package -->
437127ab6a12 non-working version
cin
parents: 2
diff changeset
13 <xsl:template match="m:package[@primary='true' and @clr:namespace]" mode="document">
437127ab6a12 non-working version
cin
parents: 2
diff changeset
14 <cs:namespace name="{@clr:namespace}">
437127ab6a12 non-working version
cin
parents: 2
diff changeset
15 <xsl:apply-templates mode="document" />
437127ab6a12 non-working version
cin
parents: 2
diff changeset
16 </cs:namespace>
437127ab6a12 non-working version
cin
parents: 2
diff changeset
17 </xsl:template>
437127ab6a12 non-working version
cin
parents: 2
diff changeset
18
437127ab6a12 non-working version
cin
parents: 2
diff changeset
19 <xsl:template match="m:package[@primary='true']" mode="document">
437127ab6a12 non-working version
cin
parents: 2
diff changeset
20 <xsl:apply-templates mode="document" />
437127ab6a12 non-working version
cin
parents: 2
diff changeset
21 </xsl:template>
437127ab6a12 non-working version
cin
parents: 2
diff changeset
22
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
23 <!-- entity -->
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
24 <xsl:template match="m:entity" mode="document">
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
25 <xsl:apply-templates select="." mode="entity"/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
26 </xsl:template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
27
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
28 <xsl:template match="m:entity" mode="entity">
5
cin
parents: 4
diff changeset
29 <!-- select all members -->
4
cin
parents: 3
diff changeset
30 <xsl:variable name="members">
6
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
31 <xsl:apply-templates mode="filter-members"/>
4
cin
parents: 3
diff changeset
32 </xsl:variable>
5
cin
parents: 4
diff changeset
33
3
437127ab6a12 non-working version
cin
parents: 2
diff changeset
34 <cs:class modifiers="partial">
5
cin
parents: 4
diff changeset
35 <!-- generate class name -->
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
36 <xsl:attribute name="name">
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
37 <xsl:apply-templates select="." mode="class-name"/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
38 </xsl:attribute>
5
cin
parents: 4
diff changeset
39 <xsl:attribute name="modifiers">
cin
parents: 4
diff changeset
40 <xsl:apply-templates select="." mode="class-modifiers"/>
cin
parents: 4
diff changeset
41 </xsl:attribute>
cin
parents: 4
diff changeset
42
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
43 <xsl:apply-templates mode="class-attributes" />
4
cin
parents: 3
diff changeset
44 <xsl:apply-templates select="exsl:node-set($members)" mode="members" />
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
45 </cs:class>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
46 </xsl:template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
47
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
48 <!-- class-name -->
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
49 <xsl:template match="*[@name]" mode="class-name">
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
50 <xsl:value-of select="@name"/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
51 </xsl:template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
52
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
53 <xsl:template match="*[@clr:name]" mode="class-name">
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
54 <xsl:value-of select="@clr:name"/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
55 </xsl:template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
56
5
cin
parents: 4
diff changeset
57 <!-- class-modifiers -->
cin
parents: 4
diff changeset
58 <xsl:template match="*" mode="class-modifiers">
cin
parents: 4
diff changeset
59 <xsl:text>partial</xsl:text>
cin
parents: 4
diff changeset
60 </xsl:template>
cin
parents: 4
diff changeset
61
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
62 <!-- class-attributes -->
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
63 <xsl:template match="*|text()" mode="class-attributes" />
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
64
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
65 <xsl:template match="sql:table" mode="class-attributes">
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
66 <cs:attribute>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
67 <cs:type name="Table" namespace="Linq2Db" />
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
68 <cs:parameter><cs:string text="{@name}"/></cs:parameter>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
69 </cs:attribute>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
70 </xsl:template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
71
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
72 <!-- generate members -->
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
73
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
74 <xsl:template match="*|text()" mode="members" />
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
75
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
76 <xsl:template match="m:primaryKey | m:property | m:thisKey | clr:association" mode="members">
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
77 <t:trace msg="{name()} {@name}"/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
78 <xsl:apply-templates select="." mode="property"/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
79 </xsl:template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
80
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
81 <!-- hasA and hasMany doesn't generate members itself, they delegate this work to inner members -->
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
82 <xsl:template match="m:hasA | m:hasMany" mode="members">
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
83 <t:trace msg="{name()} {@name}" />
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
84 <xsl:apply-templates mode="members" />
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
85 </xsl:template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
86
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
87 <xsl:template match="m:hasA/clr:lazy" mode="members">
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
88 <xsl:apply-templates select="." mode="field"/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
89 </xsl:template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
90
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
91 <!-- member-name -->
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
92 <xsl:template match="*|text()|@*" mode="member-name" />
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
93
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
94 <xsl:template match="*[@name]" mode="member-name">
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
95 <xsl:value-of select="@name"/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
96 </xsl:template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
97 <xsl:template match="*[@clr:name]" mode="member-name">
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
98 <xsl:value-of select="@clr:name"/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
99 </xsl:template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
100
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
101 <!-- member-type -->
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
102 <xsl:template match="*|text()|@*" mode="member-type" />
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
103
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
104 <xsl:template match="*[@type]" mode="member-type">
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
105 <xsl:call-template name="getClrType">
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
106 <xsl:with-param name="type" select="@type" />
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
107 </xsl:call-template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
108 </xsl:template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
109
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
110 <xsl:template match="*[clr:type]" mode="member-type">
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
111 <xsl:apply-templates select="clr:type" mode="clr-type" />
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
112 </xsl:template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
113
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
114 <!-- member-attributes -->
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
115 <xsl:template match="*|text()" mode="member-attributes"/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
116
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
117 <!-- member-extension -->
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
118 <xsl:template match="*|text()" mode="member-extension"/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
119 <xsl:template match="*" mode="member-extension">
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
120 <xsl:apply-templates mode="member-extension-comments"/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
121 </xsl:template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
122
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
123 <xsl:template match="m:hasA/* | m:hasMany/*" mode="member-extension">
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
124 <xsl:variable name="comments" select="../m:description | m:description"/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
125 <xsl:apply-templates select="$comments[position() = count($comments)]" mode="member-extension-comments"/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
126 </xsl:template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
127
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
128 <!-- member-extension-comments -->
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
129 <xsl:template match="*|text()" mode="member-extension-comments"/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
130
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
131 <xsl:template match="m:description" mode="member-extension-comments">
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
132 <cs:comments>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
133 <xsl:apply-templates mode="comments" />
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
134 </cs:comments>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
135 </xsl:template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
136
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
137 <!-- property -->
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
138
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
139 <xsl:template match="*" mode="property">
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
140 <cs:property modifiers="public">
6
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
141 <xsl:attribute name="name"><xsl:apply-templates select="." mode="member-name"/></xsl:attribute>
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
142 <xsl:attribute name="modifiers"><xsl:apply-templates select="." mode="member-modifiers"/></xsl:attribute>
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
143 <xsl:apply-templates select="." mode="member-type"/>
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
144 <xsl:apply-templates select="." mode="member-attributes"/>
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
145 <xsl:apply-templates select="." mode="member-extension" />
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
146 <xsl:apply-templates select="." mode="property-accessors"/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
147 </cs:property>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
148 </xsl:template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
149
5
cin
parents: 4
diff changeset
150
6
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
151 <!-- member-name -->
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
152 <xsl:template match="m:hasA/clr:association[not(@name|@clr:name)]" mode="member-name">
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
153 <!-- if the association doesn't define a name, use it from the parent node -->
6
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
154 <xsl:apply-templates select=".." mode="member-name"/>
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
155 </xsl:template>
6
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
156 <xsl:template match="m:hasMany/clr:association[not(@name|@clr:name)]" mode="member-name">
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
157 <!-- if the association doesn't define a name, use it from the parent node -->
6
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
158 <xsl:apply-templates select=".." mode="member-name"/>
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
159 </xsl:template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
160
6
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
161 <!-- member-modifiers -->
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
162 <xsl:template match="*" mode="member-modifiers">
3
437127ab6a12 non-working version
cin
parents: 2
diff changeset
163 <xsl:text>public</xsl:text>
437127ab6a12 non-working version
cin
parents: 2
diff changeset
164 </xsl:template>
437127ab6a12 non-working version
cin
parents: 2
diff changeset
165
6
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
166 <!-- member-type -->
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
167 <xsl:template match="m:hasA[@type]/clr:association[not(clr:type)]" mode="member-type">
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
168 <xsl:apply-templates select=".." mode="member-type"/>
5
cin
parents: 4
diff changeset
169 </xsl:template>
cin
parents: 4
diff changeset
170
6
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
171 <xsl:template match="m:hasMany[@type]/clr:association[not(clr:type)]" mode="member-type">
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
172 <cs:array>
6
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
173 <xsl:apply-templates select=".." mode="member-type"/>
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
174 </cs:array>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
175 </xsl:template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
176
6
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
177 <xsl:template match="m:hasA[@type]/m:thisKey" mode="member-type">
5
cin
parents: 4
diff changeset
178 <xsl:variable name="otherKey">
3
437127ab6a12 non-working version
cin
parents: 2
diff changeset
179 <xsl:call-template name="getPrimaryKey">
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
180 <xsl:with-param name="type" select="../@type"/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
181 </xsl:call-template>
5
cin
parents: 4
diff changeset
182 </xsl:variable>
cin
parents: 4
diff changeset
183 <xsl:choose>
cin
parents: 4
diff changeset
184 <xsl:when test="@optional">
6
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
185 <cs:nullable>
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
186 <xsl:apply-templates select="exsl:node-set($otherKey)" mode="member-type"/>
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
187 </cs:nullable>
5
cin
parents: 4
diff changeset
188 </xsl:when>
cin
parents: 4
diff changeset
189 <xsl:otherwise>
6
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
190 <xsl:apply-templates select="exsl:node-set($otherKey)" mode="member-type"/>
5
cin
parents: 4
diff changeset
191 </xsl:otherwise>
cin
parents: 4
diff changeset
192 </xsl:choose>
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
193 </xsl:template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
194
6
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
195 <!-- member-attributes -->
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
196 <xsl:template match="m:primaryKey" mode="member-attributes">
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
197 <cs:attribute>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
198 <cs:type name="PrimaryKey" namespace="Linq2Db" />
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
199 </cs:attribute>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
200 </xsl:template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
201
6
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
202 <xsl:template match="m:hasA/clr:association" mode="member-attributes">
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
203 <cs:attribute>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
204 <cs:type name="Association" namespace="Linq2Db"/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
205 <cs:parameter name="thisKey">
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
206 <cs:nameOf>
6
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
207 <xsl:call-template name="getClrMemberReference">
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
208 <xsl:with-param name="memberName" select="../@name"/>
6
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
209 <xsl:with-param name="type" select="../@declaringType"/>
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
210 </xsl:call-template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
211 </cs:nameOf>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
212 </cs:parameter>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
213 <cs:parameter name="otherKey">
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
214 <cs:nameOf>
6
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
215 <xsl:call-template name="getClrKeyReference">
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
216 <xsl:with-param name="type" select="../@type"/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
217 </xsl:call-template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
218 </cs:nameOf>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
219 </cs:parameter>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
220 </cs:attribute>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
221 </xsl:template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
222
6
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
223 <xsl:template match="m:hasMany/clr:association" mode="member-attributes">
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
224 <cs:attribute>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
225 <cs:type name="Association" namespace="Linq2Db"/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
226 <!-- thisKey points to own primaryKey which may be inherited, using getKeyName to address such cases -->
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
227 <cs:parameter name="thisKey">
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
228 <cs:nameOf>
6
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
229 <xsl:call-template name="getClrKeyReference">
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
230 <xsl:with-param name="type" select="../../@name"/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
231 </xsl:call-template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
232 </cs:nameOf>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
233 </cs:parameter>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
234 <cs:parameter name="otherKey">
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
235 <cs:nameOf>
6
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
236 <xsl:call-template name="getClrMemberReference">
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
237 <xsl:with-param name="type" select="../@type"/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
238 <xsl:with-param name="memberName" select="../m:otherKey/@name"/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
239 </xsl:call-template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
240 </cs:nameOf>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
241 </cs:parameter>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
242 </cs:attribute>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
243 </xsl:template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
244
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
245 <!-- property-accessors -->
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
246 <xsl:template match="*" mode="property-accessors">
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
247 <cs:get/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
248 <cs:set/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
249 </xsl:template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
250
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
251 <xsl:template match="m:hasA[clr:lazy]/m:thisKey" mode="property-accessors">
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
252 <cs:get>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
253 <xsl:text>return </xsl:text>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
254 <xsl:apply-templates select="../clr:lazy" mode="field-name"/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
255 <xsl:text>.Key;</xsl:text>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
256 </cs:get>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
257 <cs:set>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
258 <xsl:apply-templates select="../clr:lazy" mode="field-name"/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
259 <xsl:text>.Key = value;</xsl:text>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
260 </cs:set>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
261 </xsl:template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
262
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
263 <xsl:template match="m:hasA[clr:lazy]/clr:association" mode="property-accessors">
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
264 <cs:get>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
265 <xsl:text>return </xsl:text>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
266 <xsl:apply-templates select="../clr:lazy" mode="field-name"/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
267 <xsl:text>.Instance;</xsl:text>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
268 </cs:get>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
269 <cs:set>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
270 <xsl:apply-templates select="../clr:lazy" mode="field-name"/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
271 <xsl:text>.Instance = value;</xsl:text>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
272 </cs:set>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
273 </xsl:template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
274
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
275 <!-- fields -->
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
276 <xsl:template match="*" mode="field">
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
277 <cs:field>
6
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
278 <xsl:attribute name="name"><xsl:apply-templates select="." mode="member-name"/></xsl:attribute>
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
279 <xsl:apply-templates select="." mode="member-type"/>
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
280 <xsl:apply-templates select="." mode="field-initializer"/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
281 </cs:field>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
282 </xsl:template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
283
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
284 <!-- field-name -->
6
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
285 <xsl:template match="m:hasA/clr:lazy" mode="member-name">
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
286 <xsl:text>m_lazy</xsl:text>
6
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
287 <xsl:apply-templates select=".." mode="member-name"/>
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
288 </xsl:template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
289
6
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
290 <xsl:template match="clr:lazy[@field]" mode="member-name">
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
291 <xsl:value-of select="@field"/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
292 </xsl:template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
293
6
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
294 <!-- member-type -->
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
295 <xsl:template match="m:hasA[@optional='true']/clr:lazy" mode="member-type">
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
296 <xsl:variable name="otherKey">
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
297 <xsl:call-template name="getPrimaryKey">
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
298 <xsl:with-param name="type" select="../@type"/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
299 </xsl:call-template>
6
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
300 </xsl:variable>
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
301 <cs:type name="NullableReference" namespace="Pallada.Data">
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
302 <xsl:apply-templates select="exsl:node-set($otherKey)" mode="member-type"/>
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
303 <xsl:apply-templates select=".." mode="member-type"/>
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
304 </cs:type>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
305 </xsl:template>
6
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
306 <xsl:template match="m:hasA[@optional!='true']/clr:lazy" mode="member-type">
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
307 <cs:type name="Reference" namespace="Pallada.Data">
6
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
308 <xsl:apply-templates select="../m:thisKey" mode="member-type"/>
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
309 <xsl:apply-templates select=".." mode="member-type"/>
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
310 </cs:type>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
311 </xsl:template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
312
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
313 <!-- field-initializer -->
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
314 <xsl:template match="*|text()" mode="field-initializer"/>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
315
5
cin
parents: 4
diff changeset
316 <xsl:template name="getClrKeyReference">
cin
parents: 4
diff changeset
317 <xsl:param name="type"/>
cin
parents: 4
diff changeset
318 <xsl:variable name="primaryKey">
cin
parents: 4
diff changeset
319 <xsl:call-template name="getPrimaryKey">
cin
parents: 4
diff changeset
320 <xsl:with-param name="type" select="$type"/>
cin
parents: 4
diff changeset
321 </xsl:call-template>
cin
parents: 4
diff changeset
322 </xsl:variable>
cin
parents: 4
diff changeset
323
cin
parents: 4
diff changeset
324 <xsl:apply-templates select="exsl:node-set($primaryKey)" mode="clr-member-reference"/>
cin
parents: 4
diff changeset
325 </xsl:template>
cin
parents: 4
diff changeset
326
cin
parents: 4
diff changeset
327 <!-- -->
cin
parents: 4
diff changeset
328 <xsl:template name="getClrMemberReference">
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
329 <xsl:param name="type"/>
5
cin
parents: 4
diff changeset
330 <xsl:param name="memberName"/>
cin
parents: 4
diff changeset
331 <xsl:param name="scope" select="members"/>
cin
parents: 4
diff changeset
332 <xsl:variable name="member">
cin
parents: 4
diff changeset
333 <xsl:call-template name="getMembers">
cin
parents: 4
diff changeset
334 <xsl:with-param name="memberName" select="$memberName"/>
cin
parents: 4
diff changeset
335 <xsl:with-param name="type" select="$type"/>
cin
parents: 4
diff changeset
336 </xsl:call-template>
cin
parents: 4
diff changeset
337 </xsl:variable>
cin
parents: 4
diff changeset
338
cin
parents: 4
diff changeset
339 <xsl:apply-templates select="exsl:node-set($member)" mode="clr-member-reference"/>
cin
parents: 4
diff changeset
340 </xsl:template>
cin
parents: 4
diff changeset
341
cin
parents: 4
diff changeset
342 <xsl:template match="*" mode="clr-member-reference">
6
1f4009d4afb6 working on model to csharp transform
cin
parents: 5
diff changeset
343 <xsl:param name="type" select="@declaringType"/>
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
344 <cs:member>
5
cin
parents: 4
diff changeset
345 <xsl:attribute name="name">
cin
parents: 4
diff changeset
346 <xsl:apply-templates select="." mode="member-name"/>
cin
parents: 4
diff changeset
347 </xsl:attribute>
cin
parents: 4
diff changeset
348 <xsl:call-template name="getClrType">
cin
parents: 4
diff changeset
349 <xsl:with-param name="type" select="$type"/>
cin
parents: 4
diff changeset
350 </xsl:call-template>
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
351 </cs:member>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
352 </xsl:template>
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
353
3
437127ab6a12 non-working version
cin
parents: 2
diff changeset
354 <!-- resolves CLR type for the given type -->
437127ab6a12 non-working version
cin
parents: 2
diff changeset
355 <xsl:template name="getClrType">
437127ab6a12 non-working version
cin
parents: 2
diff changeset
356 <xsl:param name="type" />
437127ab6a12 non-working version
cin
parents: 2
diff changeset
357 <xsl:param name="typeArgs" select="/.." />
437127ab6a12 non-working version
cin
parents: 2
diff changeset
358 <!-- <t:trace msg="resolveClrType {$type}"/> -->
437127ab6a12 non-working version
cin
parents: 2
diff changeset
359 <xsl:for-each select="$module">
437127ab6a12 non-working version
cin
parents: 2
diff changeset
360 <xsl:apply-templates select="key('type', $type)"
437127ab6a12 non-working version
cin
parents: 2
diff changeset
361 mode="clr-type">
437127ab6a12 non-working version
cin
parents: 2
diff changeset
362 <xsl:with-param name="typeArgs" select="$typeArgs"/>
437127ab6a12 non-working version
cin
parents: 2
diff changeset
363 </xsl:apply-templates>
437127ab6a12 non-working version
cin
parents: 2
diff changeset
364 </xsl:for-each>
437127ab6a12 non-working version
cin
parents: 2
diff changeset
365 </xsl:template>
437127ab6a12 non-working version
cin
parents: 2
diff changeset
366
437127ab6a12 non-working version
cin
parents: 2
diff changeset
367 <!-- CLR type construction -->
437127ab6a12 non-working version
cin
parents: 2
diff changeset
368 <xsl:template match="*" mode="clr-type" />
437127ab6a12 non-working version
cin
parents: 2
diff changeset
369
437127ab6a12 non-working version
cin
parents: 2
diff changeset
370 <xsl:template match="m:type[clr:type]" mode="clr-type">
437127ab6a12 non-working version
cin
parents: 2
diff changeset
371 <xsl:param name="typeArgs" select="clr:type/*" />
437127ab6a12 non-working version
cin
parents: 2
diff changeset
372 <xsl:apply-templates select="clr:type" mode="clr-type">
437127ab6a12 non-working version
cin
parents: 2
diff changeset
373 <xsl:with-param name="typeArgs" select="$typeArgs" />
437127ab6a12 non-working version
cin
parents: 2
diff changeset
374 </xsl:apply-templates>
437127ab6a12 non-working version
cin
parents: 2
diff changeset
375 </xsl:template>
437127ab6a12 non-working version
cin
parents: 2
diff changeset
376
437127ab6a12 non-working version
cin
parents: 2
diff changeset
377 <xsl:template match="m:entity" mode="clr-type">
437127ab6a12 non-working version
cin
parents: 2
diff changeset
378 <cs:type name="{@clr:name | @name[not(../@clr:name)]}" namespace="{ancestor::*[@clr:namespace]/@clr:namespace}" />
437127ab6a12 non-working version
cin
parents: 2
diff changeset
379 </xsl:template>
437127ab6a12 non-working version
cin
parents: 2
diff changeset
380
437127ab6a12 non-working version
cin
parents: 2
diff changeset
381 <xsl:template match="clr:type" mode="clr-type">
437127ab6a12 non-working version
cin
parents: 2
diff changeset
382 <xsl:apply-templates mode="clr-type"/>
437127ab6a12 non-working version
cin
parents: 2
diff changeset
383 </xsl:template>
437127ab6a12 non-working version
cin
parents: 2
diff changeset
384
437127ab6a12 non-working version
cin
parents: 2
diff changeset
385 <xsl:template match="clr:type[@ref]" mode="clr-type">
437127ab6a12 non-working version
cin
parents: 2
diff changeset
386 <xsl:param name="typeArgs" select="*" />
437127ab6a12 non-working version
cin
parents: 2
diff changeset
387 <xsl:call-template name="getClrType">
437127ab6a12 non-working version
cin
parents: 2
diff changeset
388 <xsl:with-param name="type" select="@ref" />
437127ab6a12 non-working version
cin
parents: 2
diff changeset
389 <xsl:with-param name="typeArgs" select="$typeArgs" />
437127ab6a12 non-working version
cin
parents: 2
diff changeset
390 </xsl:call-template>
437127ab6a12 non-working version
cin
parents: 2
diff changeset
391 </xsl:template>
437127ab6a12 non-working version
cin
parents: 2
diff changeset
392
437127ab6a12 non-working version
cin
parents: 2
diff changeset
393 <xsl:template match="clr:type[@cs:name or @name]" mode="clr-type">
437127ab6a12 non-working version
cin
parents: 2
diff changeset
394 <xsl:param name="typeArgs" select="*" />
437127ab6a12 non-working version
cin
parents: 2
diff changeset
395 <xsl:variable name="ns"
437127ab6a12 non-working version
cin
parents: 2
diff changeset
396 select="@cs:namespace | @namespace[not(../@cs:namespace)]" />
437127ab6a12 non-working version
cin
parents: 2
diff changeset
397 <cs:type name="{@cs:name | @name[not(../@cs:name)]}">
437127ab6a12 non-working version
cin
parents: 2
diff changeset
398 <xsl:if test="$ns">
437127ab6a12 non-working version
cin
parents: 2
diff changeset
399 <xsl:attribute name="namespace"><xsl:value-of select="$ns" /></xsl:attribute>
437127ab6a12 non-working version
cin
parents: 2
diff changeset
400 </xsl:if>
437127ab6a12 non-working version
cin
parents: 2
diff changeset
401 <xsl:copy-of select="@struct"/>
437127ab6a12 non-working version
cin
parents: 2
diff changeset
402
437127ab6a12 non-working version
cin
parents: 2
diff changeset
403 <xsl:apply-templates select="$typeArgs | *[not($typeArgs)]"
437127ab6a12 non-working version
cin
parents: 2
diff changeset
404 mode="clr-type" />
437127ab6a12 non-working version
cin
parents: 2
diff changeset
405 </cs:type>
437127ab6a12 non-working version
cin
parents: 2
diff changeset
406 </xsl:template>
437127ab6a12 non-working version
cin
parents: 2
diff changeset
407
437127ab6a12 non-working version
cin
parents: 2
diff changeset
408 <xsl:template match="clr:arrayOf[@type]" mode="clr-type">
437127ab6a12 non-working version
cin
parents: 2
diff changeset
409 <xsl:param name="typeArgs" select="*" />
437127ab6a12 non-working version
cin
parents: 2
diff changeset
410 <cs:array>
437127ab6a12 non-working version
cin
parents: 2
diff changeset
411 <xsl:call-template name="getClrType">
437127ab6a12 non-working version
cin
parents: 2
diff changeset
412 <xsl:with-param name="type" select="@type" />
437127ab6a12 non-working version
cin
parents: 2
diff changeset
413 <xsl:with-param name="typeArgs" select="$typeArgs" />
437127ab6a12 non-working version
cin
parents: 2
diff changeset
414 </xsl:call-template>
437127ab6a12 non-working version
cin
parents: 2
diff changeset
415 </cs:array>
437127ab6a12 non-working version
cin
parents: 2
diff changeset
416 </xsl:template>
437127ab6a12 non-working version
cin
parents: 2
diff changeset
417
437127ab6a12 non-working version
cin
parents: 2
diff changeset
418 <xsl:template match="clr:arrayOf[@cs:name or @name]" mode="clr-type">
437127ab6a12 non-working version
cin
parents: 2
diff changeset
419 <xsl:param name="typeArgs" select="*" />
437127ab6a12 non-working version
cin
parents: 2
diff changeset
420 <xsl:variable name="ns"
437127ab6a12 non-working version
cin
parents: 2
diff changeset
421 select="@cs:namespace | @namespace[not(../@cs:namespace)]" />
437127ab6a12 non-working version
cin
parents: 2
diff changeset
422 <cs:array>
437127ab6a12 non-working version
cin
parents: 2
diff changeset
423 <cs:type name="{@cs:name | @name[not(../@cs:name)]}">
437127ab6a12 non-working version
cin
parents: 2
diff changeset
424 <xsl:if test="$ns">
437127ab6a12 non-working version
cin
parents: 2
diff changeset
425 <xsl:attribute name="namespace"><xsl:value-of
437127ab6a12 non-working version
cin
parents: 2
diff changeset
426 select="$ns" /></xsl:attribute>
437127ab6a12 non-working version
cin
parents: 2
diff changeset
427 </xsl:if>
437127ab6a12 non-working version
cin
parents: 2
diff changeset
428 <xsl:apply-templates select="$typeArgs | *[not($typeArgs)]"
437127ab6a12 non-working version
cin
parents: 2
diff changeset
429 mode="clr-type" />
437127ab6a12 non-working version
cin
parents: 2
diff changeset
430 </cs:type>
437127ab6a12 non-working version
cin
parents: 2
diff changeset
431 </cs:array>
437127ab6a12 non-working version
cin
parents: 2
diff changeset
432 </xsl:template>
437127ab6a12 non-working version
cin
parents: 2
diff changeset
433
2
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
434
035de8b7b18e Temporary commit, refactoring, added readme
cin
parents:
diff changeset
435 </xsl:stylesheet>