SandBox: dotTest.xslt

File dotTest.xslt, 1.8 kB (added by margs, 17 years ago)
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2
3<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
4        <xsl:output method="text" omit-xml-declaration="yes"/>
5
6        <xsl:template match="/">
7
8     
9      digraph G {
10      rankdir="BT";
11                        overlap="false";
12      node [fontname=Arial, fontsize=11];
13
14      <!-- TO DO: add coloring according to level and thing/relationship? See static web pages. -->
15                       
16
17                <xsl:for-each select="//RDLthing">
18                       
19      <!-- write node -->
20      <xsl:value-of select="idPCA"/>
21      [shape="box", color="#00CC00", label="<xsl:value-of select="designation"/>"];
22                       
23                </xsl:for-each>
24               
25
26    <xsl:for-each select="//RDLrelationship">
27
28      <!-- different formatting accoring to type of relationship -->
29      <xsl:choose>
30        <xsl:when test="type = 'CLASSIFICATION'">
31          <xsl:value-of select="concat(idPCAL, ' -&gt; ', idPCAR)"/>
32          [arrowhead="none", arrowtail="normal"];
33        </xsl:when>
34
35        <xsl:when test="type = 'SPECIALIZATION'">
36          <xsl:value-of select="concat(idPCAL, ' -&gt; ', idPCAR)"/>
37          [arrowhead="none", arrowtail="dot"];
38        </xsl:when>
39
40        <xsl:otherwise>
41
42          <!-- TO DO: Add cardinalities. And rolenames? -->
43
44          <!-- node -->
45          <xsl:value-of select="idPCA"/>
46          [shape="diamond", color="#00CCFF", fixedsize=true, width=2, height=0.7, label="<xsl:value-of select="designation"/>"];
47         
48          <!-- edges -->
49          <xsl:value-of select="concat(idPCAL, ' -&gt; ', idPCA)"/>
50          [arrowhead="none", color="#00CCFF"];
51         
52          <xsl:value-of select="concat(idPCA, ' -&gt; ', idPCAR)"/>
53          [arrowhead="none", color="#00CCFF"];
54         
55        </xsl:otherwise>
56       
57      </xsl:choose>
58
59                </xsl:for-each>
60    }
61
62        </xsl:template>
63
64</xsl:stylesheet>
Home
About PCA
Reference Data Services
Projects
Workgroups