sysmodellibs/sysmodelgen/extra/output-csv.xsl
author Bob Rosenberg <bob.rosenberg@nokia.com>
Wed, 13 Oct 2010 16:21:25 +0100
changeset 7 3c36c452f013
parent 6 sysmodellibs/sysmodelgen/src/old/svg/output-csv.xsl@5b32dc297d05
permissions -rw-r--r--
Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
     1
<stylesheet version="1.0" xmlns="http://www.w3.org/1999/XSL/Transform" 
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
     2
	exclude-result-prefixes="set exslt"
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
     3
	xmlns:exslt="http://exslt.org/common"
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
     4
	xmlns:set="http://exslt.org/sets">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
     5
	<output method="text"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
     6
	<!-- 
7
3c36c452f013 Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 6
diff changeset
     7
	tech_domain,layer,package,collection,component,old_layer,old_package<value-of select="$atts"/>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
     8
	Foundation Tech Domain,Foundation layer,Foundation package,Foundation collection,Component,Layer,Domain,Subsystem<value-of select="$atts"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
     9
	-->
7
3c36c452f013 Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 6
diff changeset
    10
	<variable name="default-atts">layer,package,collection,component</variable>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    11
	<param name="atts">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    12
		<value-of select="$default-atts"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    13
		<call-template name="all-atts"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    14
	</param>
7
3c36c452f013 Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 6
diff changeset
    15
	<param name="labels"><if test="starts-with($atts,$default-atts)">Layer,Package,Collection,Component</if></param>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    16
	
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    17
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    18
<key name="tech" match="group[@type='color']/cbox" use="@style-id"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    19
  
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    20
  
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    21
  <template name="all-atts">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    22
  <variable name="all">
7
3c36c452f013 Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 6
diff changeset
    23
  	<apply-templates select="//layer/@* | //package/@*| //collection/@*| //component/@*" mode="atts">
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    24
			<sort select="name()"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    25
		</apply-templates>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    26
	</variable>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    27
	<for-each select="set:distinct(exslt:node-set($all)/*/@v)">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    28
		<sort select="."/>,<value-of select="."/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    29
	</for-each>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    30
  </template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    31
  
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    32
<template name="labels"><param name="at" select="$atts"/><param name="label" select="$labels"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    33
	<variable name="At">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    34
		<choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    35
			<when test="contains($at,',')"><value-of select="substring-before($at,',')"/></when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    36
			<otherwise><value-of select="$at"/></otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    37
		</choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    38
	</variable>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    39
	<variable name="Lab">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    40
		<choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    41
			<when test="contains($label,',')"><value-of select="substring-before($label,',')"/></when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    42
			<otherwise><value-of select="$label"/></otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    43
		</choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    44
	</variable>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    45
	<choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    46
		<when test="not(contains($at,',')) and $Lab!=''"><value-of select="$Lab"/></when> <!-- at end of list, use label  -->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    47
		<when test="not(contains($at,','))"><value-of select="$At"/></when><!-- at end of list-->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    48
		<when test="$Lab!=''">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    49
			<value-of select="$Lab"/><text>,</text>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    50
			<call-template name="labels">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    51
				<with-param name="at" select="substring-after($at,',')"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    52
				<with-param name="label" select="substring-after($label,',')"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    53
			</call-template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    54
		</when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    55
		<otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    56
			<value-of select="$At"/><text>,</text>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    57
			<call-template name="labels">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    58
				<with-param name="at" select="substring-after($at,',')"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    59
				<with-param name="label" select="substring-after($label,',')"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    60
			</call-template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    61
		</otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    62
	</choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    63
</template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    64
  
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    65
<template match="/SystemDefinition"><call-template name="labels"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    66
	<text>&#xa;</text>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    67
 <apply-templates select="systemModel/layer//component"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    68
</template> 
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    69
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    70
<template match="component">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    71
	<call-template name="others"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    72
	<text>&#xa;</text>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    73
</template> 
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    74
7
3c36c452f013 Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 6
diff changeset
    75
<template match="*" mode="name"><apply-templates select="@id" mode="name"/></template>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    76
<!-- <template match="@*" mode="name">"<value-of select="."/>"</template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    77
<template match="@*[contains(.,',')]" mode="name" priority="9">"<value-of select="."/>"</template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    78
-->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    79
<template match="@*" mode="name" priority="7">"<value-of select="."/>"</template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    80
<template match="@*[not(contains(.,','))]" mode="name" priority="8"><value-of select="."/></template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    81
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    82
<template match="@*" mode="atts" priority="-1">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    83
	<element name="a"><attribute name="v"><value-of select="name()"/></attribute></element>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    84
</template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    85
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    86
<!--template match="@name|@old_layer|@old_package|@id|@abbrev|@plugin|@introduced|@span|@levels|@level|@tech_domain|@platform_optional|@reason" mode="atts"/-->
7
3c36c452f013 Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 6
diff changeset
    87
<template match="@name|@abbrev|@id" mode="atts"/>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    88
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    89
<template name="others"><param name="at" select="$atts"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    90
	<variable name="a">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    91
		<choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    92
			<when test="contains($at,',')"><value-of select="substring-before($at,',')"/></when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    93
			<otherwise><value-of select="$at"/></otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    94
		</choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    95
	</variable>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    96
	<choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    97
		<when test="$a='module' and @module"><apply-templates select="@module" mode="name"/></when>
7
3c36c452f013 Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 6
diff changeset
    98
		<when test="$a='module'"><apply-templates select="ancestor::package[1]" mode="name"/></when>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    99
		<when test="$a='layer'"><apply-templates select="ancestor::layer" mode="name"/></when>
7
3c36c452f013 Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 6
diff changeset
   100
		<when test="$a='package'"><apply-templates select="ancestor::package" mode="name"/></when>
3c36c452f013 Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 6
diff changeset
   101
		<when test="$a='subpackage'"><apply-templates select="ancestor::package/package" mode="name"/></when>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   102
		<when test="$a='collection'"><apply-templates select="ancestor::collection" mode="name"/></when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   103
		<when test="$a='component'"><apply-templates select="." mode="name"/></when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   104
		<when test="$a='old_component'"><if test="@old_component!=@name"><apply-templates select="@old_component" mode="name"/></if></when>
7
3c36c452f013 Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 6
diff changeset
   105
		<when test="$a='tech_domain' or $a='tech-domain'">"<value-of select="ancestor::package/@tech-domain"/>"</when>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   106
		<when test="$a='level'"><value-of select="ancestor-or-self::collection/@level"/></when>
7
3c36c452f013 Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 6
diff changeset
   107
		<when test="$a='levels'">"<value-of select="ancestor-or-self::package/@levels"/>"</when>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   108
		<when test="$a='layer-levels'">"<value-of select="ancestor-or-self::layer/@levels"/>"</when>
7
3c36c452f013 Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 6
diff changeset
   109
		<when test="$a='package-level'"><value-of select="ancestor-or-self::package/@level"/></when>
3c36c452f013 Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 6
diff changeset
   110
		<when test="contains(concat($a,'&#xa;'),'-name&#xa;')"><apply-templates mode="name" select="ancestor-or-self::*[name()=substring-before($a,'-')]/@name"/></when>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   111
		<when test="@*[name()=$a]"><apply-templates select="@*[name()=$a]" mode="name"/></when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   112
		<when test="ancestor::collection/@*[name()=$a]"><apply-templates select="ancestor::collection/@*[name()=$a]" mode="name"/></when>
7
3c36c452f013 Version 2.0 release of System Model Generator, which draws 3.x syntax system definition files
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 6
diff changeset
   113
		<when test="ancestor::package/@*[name()=$a]"><apply-templates select="ancestor::package/@*[name()=$a]" mode="name"/></when>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   114
		<otherwise><apply-templates select="ancestor::layer/@*[name()=$a]" mode="name"/></otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   115
	</choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   116
	<if test="contains($at,',')">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   117
		<text>,</text>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   118
		<call-template name="others">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   119
			<with-param name="at" select="substring-after($at,',')"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   120
		</call-template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   121
	</if>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   122
</template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   123
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   124
</stylesheet>