Mercurial > pub > ModelGenerator
annotate xslt/test-model.xsl @ 12:191b81b2052b
first version of the xslt transform from xml to json
author | cin |
---|---|
date | Mon, 09 Apr 2018 06:43:46 +0300 |
parents | 19a8a71eaa54 |
children |
rev | line source |
---|---|
10
19a8a71eaa54
added test-model.xsl template for testing purpose of model.xsl
cin
parents:
diff
changeset
|
1 <?xml version="1.0" encoding="UTF-8"?> |
19a8a71eaa54
added test-model.xsl template for testing purpose of model.xsl
cin
parents:
diff
changeset
|
2 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:m="http://implab.org/schemas/data-model.v1.xsd" |
19a8a71eaa54
added test-model.xsl template for testing purpose of model.xsl
cin
parents:
diff
changeset
|
3 xmlns:clr="http://implab.org/schemas/data-model/dotnet.v1.xsd" |
19a8a71eaa54
added test-model.xsl template for testing purpose of model.xsl
cin
parents:
diff
changeset
|
4 xmlns:cs="http://implab.org/schemas/code-dom/csharp.v1.xsd" xmlns:sql="http://implab.org/schemas/data-model/sql.v1.xsd" |
19a8a71eaa54
added test-model.xsl template for testing purpose of model.xsl
cin
parents:
diff
changeset
|
5 xmlns:t="http://implab.org/schemas/temp" xmlns:exsl="http://exslt.org/common" |
19a8a71eaa54
added test-model.xsl template for testing purpose of model.xsl
cin
parents:
diff
changeset
|
6 exclude-result-prefixes="clr m xsl exsl sql"> |
19a8a71eaa54
added test-model.xsl template for testing purpose of model.xsl
cin
parents:
diff
changeset
|
7 <xsl:import href="model.xsl"/> |
19a8a71eaa54
added test-model.xsl template for testing purpose of model.xsl
cin
parents:
diff
changeset
|
8 |
19a8a71eaa54
added test-model.xsl template for testing purpose of model.xsl
cin
parents:
diff
changeset
|
9 <xsl:template match="m:package[boolean(@primary)]" mode="document"> |
19a8a71eaa54
added test-model.xsl template for testing purpose of model.xsl
cin
parents:
diff
changeset
|
10 <xsl:copy> |
19a8a71eaa54
added test-model.xsl template for testing purpose of model.xsl
cin
parents:
diff
changeset
|
11 <xsl:copy-of select="@*"/> |
19a8a71eaa54
added test-model.xsl template for testing purpose of model.xsl
cin
parents:
diff
changeset
|
12 <xsl:apply-templates mode="document"/> |
19a8a71eaa54
added test-model.xsl template for testing purpose of model.xsl
cin
parents:
diff
changeset
|
13 </xsl:copy> |
19a8a71eaa54
added test-model.xsl template for testing purpose of model.xsl
cin
parents:
diff
changeset
|
14 </xsl:template> |
19a8a71eaa54
added test-model.xsl template for testing purpose of model.xsl
cin
parents:
diff
changeset
|
15 <!-- entity --> |
19a8a71eaa54
added test-model.xsl template for testing purpose of model.xsl
cin
parents:
diff
changeset
|
16 <xsl:template match="m:entity" mode="document"> |
19a8a71eaa54
added test-model.xsl template for testing purpose of model.xsl
cin
parents:
diff
changeset
|
17 <xsl:apply-templates select="." mode="entity"/> |
19a8a71eaa54
added test-model.xsl template for testing purpose of model.xsl
cin
parents:
diff
changeset
|
18 </xsl:template> |
19a8a71eaa54
added test-model.xsl template for testing purpose of model.xsl
cin
parents:
diff
changeset
|
19 |
19a8a71eaa54
added test-model.xsl template for testing purpose of model.xsl
cin
parents:
diff
changeset
|
20 <xsl:template match="m:entity" mode="entity"> |
19a8a71eaa54
added test-model.xsl template for testing purpose of model.xsl
cin
parents:
diff
changeset
|
21 <!-- select all members --> |
19a8a71eaa54
added test-model.xsl template for testing purpose of model.xsl
cin
parents:
diff
changeset
|
22 <xsl:variable name="members"> |
19a8a71eaa54
added test-model.xsl template for testing purpose of model.xsl
cin
parents:
diff
changeset
|
23 <xsl:apply-templates mode="filter-members"/> |
19a8a71eaa54
added test-model.xsl template for testing purpose of model.xsl
cin
parents:
diff
changeset
|
24 </xsl:variable> |
19a8a71eaa54
added test-model.xsl template for testing purpose of model.xsl
cin
parents:
diff
changeset
|
25 |
19a8a71eaa54
added test-model.xsl template for testing purpose of model.xsl
cin
parents:
diff
changeset
|
26 <xsl:copy> |
19a8a71eaa54
added test-model.xsl template for testing purpose of model.xsl
cin
parents:
diff
changeset
|
27 <xsl:copy-of select="@*"/> |
19a8a71eaa54
added test-model.xsl template for testing purpose of model.xsl
cin
parents:
diff
changeset
|
28 |
19a8a71eaa54
added test-model.xsl template for testing purpose of model.xsl
cin
parents:
diff
changeset
|
29 <xsl:apply-templates select="exsl:node-set($members)" mode="expand-member"/> |
19a8a71eaa54
added test-model.xsl template for testing purpose of model.xsl
cin
parents:
diff
changeset
|
30 </xsl:copy> |
19a8a71eaa54
added test-model.xsl template for testing purpose of model.xsl
cin
parents:
diff
changeset
|
31 </xsl:template> |
19a8a71eaa54
added test-model.xsl template for testing purpose of model.xsl
cin
parents:
diff
changeset
|
32 </xsl:stylesheet> |