comparison xslt/test-model.xsl @ 10:19a8a71eaa54

added test-model.xsl template for testing purpose of model.xsl working on members expansion templates
author cin
date Mon, 12 Mar 2018 02:58:34 +0300
parents
children
comparison
equal deleted inserted replaced
9:d3542662cf70 10:19a8a71eaa54
1 <?xml version="1.0" encoding="UTF-8"?>
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"
3 xmlns:clr="http://implab.org/schemas/data-model/dotnet.v1.xsd"
4 xmlns:cs="http://implab.org/schemas/code-dom/csharp.v1.xsd" xmlns:sql="http://implab.org/schemas/data-model/sql.v1.xsd"
5 xmlns:t="http://implab.org/schemas/temp" xmlns:exsl="http://exslt.org/common"
6 exclude-result-prefixes="clr m xsl exsl sql">
7 <xsl:import href="model.xsl"/>
8
9 <xsl:template match="m:package[boolean(@primary)]" mode="document">
10 <xsl:copy>
11 <xsl:copy-of select="@*"/>
12 <xsl:apply-templates mode="document"/>
13 </xsl:copy>
14 </xsl:template>
15 <!-- entity -->
16 <xsl:template match="m:entity" mode="document">
17 <xsl:apply-templates select="." mode="entity"/>
18 </xsl:template>
19
20 <xsl:template match="m:entity" mode="entity">
21 <!-- select all members -->
22 <xsl:variable name="members">
23 <xsl:apply-templates mode="filter-members"/>
24 </xsl:variable>
25
26 <xsl:copy>
27 <xsl:copy-of select="@*"/>
28
29 <xsl:apply-templates select="exsl:node-set($members)" mode="expand-member"/>
30 </xsl:copy>
31 </xsl:template>
32 </xsl:stylesheet>