1 | <?xml version="1.0" encoding="UTF-8"?> |
---|
2 | <dbx:transparent |
---|
3 | xmlns:dbx="http://www.windhouwer.nl/sloot/dbx" |
---|
4 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
---|
5 | > |
---|
6 | |
---|
7 | <!-- instantiate the conceptual domain hierarchy between simple and complex DCs --> |
---|
8 | <dbx:stylesheet template="identity" when="$tree='true' or $tree='complex'"> |
---|
9 | |
---|
10 | <xsl:key name="dc" match="dc" use="id"/> |
---|
11 | <xsl:key name="val" match="dc" use="value"/> |
---|
12 | |
---|
13 | <xsl:template match="dc" mode="copy"> |
---|
14 | <xsl:copy> |
---|
15 | <xsl:apply-templates select="@*"/> |
---|
16 | <xsl:apply-templates select="node()"/> |
---|
17 | </xsl:copy> |
---|
18 | </xsl:template> |
---|
19 | |
---|
20 | <xsl:template match="value"> |
---|
21 | <xsl:choose> |
---|
22 | <xsl:when test="exists(key('dc',current()))"> |
---|
23 | <xsl:apply-templates select="key('dc',current())" mode="copy"/> |
---|
24 | </xsl:when> |
---|
25 | <xsl:otherwise> |
---|
26 | <xsl:comment>value simple DC[<xsl:value-of select="."/>] doesn't exist in this profile</xsl:comment> |
---|
27 | </xsl:otherwise> |
---|
28 | </xsl:choose> |
---|
29 | </xsl:template> |
---|
30 | |
---|
31 | <xsl:template match="/dcs/dc[exists(key('val',current()/id))]"> |
---|
32 | <xsl:comment>simple DC[<xsl:value-of select="id"/>] exists as a value</xsl:comment> |
---|
33 | </xsl:template> |
---|
34 | |
---|
35 | <xsl:template match="dc"> |
---|
36 | <xsl:apply-templates mode="copy" select="."/> |
---|
37 | </xsl:template> |
---|
38 | |
---|
39 | </dbx:stylesheet> |
---|
40 | |
---|
41 | <!-- instantiate the is-a hierarchy between simple DCs --> |
---|
42 | <dbx:stylesheet template="identity" when="$tree='true' or $tree='simple'"> |
---|
43 | |
---|
44 | <xsl:template match="dc" mode="copy"> |
---|
45 | <xsl:copy> |
---|
46 | <xsl:apply-templates select="@*"/> |
---|
47 | <xsl:apply-templates select="node()"/> |
---|
48 | <!-- copy sibling (in the same profile/DCS or value domain) sub DCs --> |
---|
49 | <xsl:apply-templates mode="copy" select="../dc[super=current()/id]"/> |
---|
50 | </xsl:copy> |
---|
51 | </xsl:template> |
---|
52 | |
---|
53 | <xsl:template match="super"> |
---|
54 | <xsl:if test="empty(../dc[super=current()/id])"> |
---|
55 | <xsl:comment>super simple DC[<xsl:value-of select="."/>] doesn't exist in this profile/DCS or value domain</xsl:comment> |
---|
56 | </xsl:if> |
---|
57 | </xsl:template> |
---|
58 | |
---|
59 | <xsl:template match="dc[exists(super) and exists(../dc[id=current()/super])]"/> |
---|
60 | |
---|
61 | <xsl:template match="dc"> |
---|
62 | <xsl:apply-templates mode="copy" select="."/> |
---|
63 | </xsl:template> |
---|
64 | |
---|
65 | </dbx:stylesheet> |
---|
66 | |
---|
67 | </dbx:transparent> |
---|