sysmodellibs/sysmodelgen/core/shapes.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/Shapes.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
<?xml version="1.0"?>
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
     2
 <xsl:stylesheet  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="http://www.w3.org/1999/XSL/Transform-" version="1.0" 
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
     3
 	xmlns:s="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" 
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
     4
 	xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:exslt="http://exslt.org/common">
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
     5
  	<xsl:output method="xml" indent="yes"/>
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
     6
	<xsl:param name="Model-Transform" select="'draw.xsl'"/> <!-- the location of the model.xsl relative to where the *output* of this transform is stored-->
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
     7
	<xsl:param name="Verbose" select="0"/> <!-- Verbosity level of messages. Set to 1 (or higher) to get runtime comments  -->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
     8
	<xsl:namespace-alias stylesheet-prefix="a" result-prefix="xsl"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
     9
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    10
<xsl:variable name="color" select="/model/layout/info[@type='color']"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    11
<xsl:variable name="borders" select="/model/layout/info[@type='border']"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    12
<xsl:variable name="overlay" select="/model/layout/info[@type='overlay']"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    13
<xsl:variable name="style" select="/model/layout/info[@type='style']"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    14
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
<xsl:template name="make-match-list"><xsl:param name="list"/><xsl:param name="suffix"/>
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
    16
	<xsl:choose>
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
    17
	<xsl:when test="0"/>
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
    18
	</xsl:choose>
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
    19
	<xsl:value-of select="concat(substring-before(concat($list,' '),' '),$suffix)"/>
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
    20
	<xsl:if test="contains($list,' ')">
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
    21
		<xsl:text>|</xsl:text>
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
    22
		<xsl:call-template name="make-match-list">
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
			<xsl:with-param name="list" select="substring-after($list,' ')"/>
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
    24
			<xsl:with-param name="suffix" select="$suffix"/>
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
    25
		</xsl:call-template>
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
    26
	</xsl:if>
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
    27
</xsl:template>
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
    28
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    29
<xsl:template match="/model"> 
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
    30
	<a:stylesheet version="1.0" exclude-result-prefixes="s exslt">
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
    31
		<xsl:for-each select="document(@shapes,.)/shapes/namespace::*"><xsl:copy-of select="."/></xsl:for-each>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    32
		<a:include href="{$Model-Transform}"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    33
		<xsl:apply-templates select="document(@shapes,.)/*"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    34
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    35
		<!--  this is a bit redundant:  i think it's only necessary for the cmp. Either that or it can be used for the component, and the stuff to 
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    36
			make the defaults for all components should be removed from model.xsl -->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    37
		<xsl:if test="$borders"> <!-- if there are borders defined in the model.xml, use those to shape the cmp borders, not the shapes.xml -->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    38
			<!-- default border -->	
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    39
			<xsl:for-each select="document($borders/@href,$borders)/values/@default">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    40
				<!-- if the default is a type, create the actual reference. If it's a reference leave it alone -->
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
    41
				<!-- this can only ever apply to components, so ignore any other rank -->
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    42
				<a:template match="component[not(@generator-border)]|cmp[not(@generator-border)]" mode="shape">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    43
					<xsl:if test="not(starts-with(.,'#'))">#Border</xsl:if>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    44
					<xsl:value-of select="."/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    45
				</a:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    46
			</xsl:for-each>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    47
		</xsl:if>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    48
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
    49
		<xsl:if test="$overlay"> <!-- if there are patterns defined in the model.xml, use those to shape the cmp overlays, not the shapes.xml 
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
    50
			 this should always have higher priority than templates from the shapes.xml -->
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    51
			<!-- default overlay (usually there will be no default))-->	
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    52
			<xsl:for-each select="document($overlay/@href,$overlay)/values/@default">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    53
				<!-- if the default is a type, create the actual reference. If it's a reference leave it alone -->
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
    54
				<xsl:variable name="match">
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
    55
					<xsl:call-template name="make-match-list">
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
    56
						<xsl:with-param name="list">
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
    57
							<xsl:value-of select="normalize-space(../@rank)"/>
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
    58
							<xsl:if test="not(../@rank)">*</xsl:if>
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
    59
							<xsl:if test="../@rank = 'component'"> cmp</xsl:if>
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
    60
						</xsl:with-param>
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
    61
						<xsl:with-param name="suffix">[not(@generator-overlay|meta/generator-overlay)]</xsl:with-param>
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
    62
					</xsl:call-template>
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
    63
				</xsl:variable>
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
    64
				<a:template match="{$match}" mode="overlays" priority="1">
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
    65
					<o>
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
    66
						<xsl:if test="not(starts-with(.,'#'))">#Pattern</xsl:if>
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
    67
						<xsl:value-of select="."/>
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
    68
					</o>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    69
				</a:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    70
			</xsl:for-each>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    71
		</xsl:if>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    72
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    73
		<xsl:if test="$color">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    74
			<xsl:for-each select="document($color/@href,$color)/values/@default">
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
				<xsl:variable name="match">
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
    76
					<xsl:call-template name="make-match-list">
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
    77
						<xsl:with-param name="list">
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
    78
							<xsl:value-of select="normalize-space(../@rank)"/>
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
    79
							<xsl:if test="not(../@rank)">*</xsl:if>
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
    80
							<xsl:if test="../@rank = 'component'"> cmp</xsl:if>
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
    81
						</xsl:with-param>
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
    82
						<xsl:with-param name="suffix">[not(@generator-color|meta/generator-color)]</xsl:with-param>
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
    83
					</xsl:call-template>
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
    84
				</xsl:variable>
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
    85
				<a:template match="{$match}" mode="display-style-color" priority="1">
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    86
					<xsl:value-of select="."/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    87
				</a:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    88
			</xsl:for-each>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    89
		</xsl:if>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    90
		
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    91
		<!-- values files with styles override any styles in the shapes file
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    92
			Also if there are no styles in the shapes file, don't try to look for them -->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    93
		<xsl:if test="not(document(@shapes)/shapes/styles) or layout/info[@type='style' and @href]">
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
    94
			<a:template match="component" mode="display-style-aux"/> <!-- no  default styles -->
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
    95
		</xsl:if>
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
    96
	
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
    97
	<xsl:for-each select="link[@expr] | layout/link[@expr]">  <!-- link should be in the layout section, but in earlier version was diretcly under model. Support both -->
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
		<xsl:variable name="extra">
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
    99
			<xsl:call-template name="computed-values">
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
				<xsl:with-param name="text" select="@expr"/>
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
			</xsl:call-template>
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
   102
		</xsl:variable>
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
   103
		<a:template mode="has-link">
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
   104
			<xsl:attribute name="match">
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
				<xsl:text>*[@id</xsl:text>
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
   106
				<xsl:if test="$extra!=''"> and (<xsl:value-of select="$extra"/>)</xsl:if>
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
				<xsl:text>]</xsl:text>
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
   108
			</xsl:attribute>
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
			<xsl:text>1</xsl:text>
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
		</a:template>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   111
		
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
   112
		<a:template mode="link-label">
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
			<xsl:attribute name="match">
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
   114
				<xsl:text>*[@id</xsl:text>
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
   115
				<xsl:if test="$extra!=''"> and (<xsl:value-of select="$extra"/>)</xsl:if>
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
   116
				<xsl:text>]</xsl:text>
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
   117
			</xsl:attribute>
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
   118
			<a:attribute name="target">
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
   119
				<xsl:value-of select="@target"/>
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
   120
				<xsl:if test="not(@target)">details</xsl:if>
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
   121
			</a:attribute>
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
   122
			<xsl:if test="@title">
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
   123
			<a:attribute name="title">
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
   124
				<xsl:value-of select="@title"/>
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
   125
			</a:attribute>
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
   126
			</xsl:if>
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
   127
			<a:attribute name="xlink:href">
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
   128
			<xsl:call-template name="computed-label">
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
   129
				<xsl:with-param name="text" select="@expr"/>
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
   130
			</xsl:call-template>
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
   131
			</a:attribute>
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
   132
		</a:template>
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
   133
	</xsl:for-each>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   134
	
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   135
	<a:template match="SystemDefinition" mode="shapes">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   136
		<xsl:variable name="defs" select="s:defs"/> <!-- all defs in the shapes document -->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   137
		<!-- check the overlay docs for all referred IDs. Make a list of all that are not defined the shapes doc -->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   138
		<xsl:variable name="undefinedP">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   139
			<xsl:for-each select="document($overlay/@href)/*">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   140
				<xsl:for-each select="@default | //item/@value">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   141
					<xsl:value-of select="concat(' ',.,' ')"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   142
				</xsl:for-each>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   143
			</xsl:for-each>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   144
			<xsl:for-each select="document(@shapes)/shapes/patterns/overlay[@type]">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   145
					<xsl:value-of select="concat(' ',@type,' ')"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   146
			</xsl:for-each>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   147
		</xsl:variable>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   148
		<!-- check the borders docs for all referred IDs. Make a list of all that are not defined the shapes doc -->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   149
		<xsl:variable name="undefinedB">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   150
			<xsl:for-each select="document($borders/@href)/*">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   151
				<xsl:for-each select="@default | //item/@value">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   152
					<xsl:value-of select="concat(' ',.,' ')"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   153
				</xsl:for-each>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   154
			</xsl:for-each>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   155
			<xsl:for-each select="document(@shapes)/shapes/borders/border/@type">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   156
					<xsl:value-of select="concat(' ',.,' ')"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   157
			</xsl:for-each>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   158
		</xsl:variable>	
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   159
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   160
	<!-- ignore all patterns not defined: should make a warning eventually. 
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   161
		Also nice to check to see if any ref'd ID's  (eg #xxx) are defined -->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   162
		
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   163
		 <!-- no 'reference' pattern defined, so use the default one --> 
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   164
		<xsl:if test="contains($undefinedP,' radial-grad ')"><a:call-template name="default-new-pattern"/></xsl:if>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   165
		 <!-- no 'new'  pattern defined, so use the default one --> 
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   166
		<xsl:if test="contains($undefinedP,' striped-diag-up ')"><a:call-template name="default-ref-pattern"/></xsl:if>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   167
		 <!-- no 'deprecated'  pattern defined, so use the default one --> 
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   168
		 <xsl:if test="contains($undefinedP,' big-X ')"><a:call-template name="default-X-pattern"/></xsl:if>
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
   169
		 
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
   170
		 <xsl:choose> <!-- can use navctrl patterns in style, so check and include if there -->
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
   171
			 <xsl:when test="contains($undefinedP,' outgrad ') or contains($undefinedP,' ingrad ')">
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
   172
			 	<a:call-template name="nav-control-patterns"/>
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
   173
			 </xsl: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
   174
			 <xsl:otherwise>
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
   175
			 	<a:if test="not(@static='true') and @navctrl">
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
   176
				 	<a:call-template name="nav-control-patterns"/>
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
   177
				</a:if>
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
   178
			 </xsl:otherwise>
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
   179
		</xsl:choose>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   180
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   181
		 <!-- borders defined --> 
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   182
		 <!--  if no borders were defined at all, throw in the default ones -->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   183
		<xsl:if test="contains($undefinedB,' box ') or normalize-space($undefinedB)=''"><a:call-template name="default-box-border"/></xsl:if>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   184
		<xsl:if test="contains($undefinedB,' box-clipLB ') or normalize-space($undefinedB)=''"><a:call-template name="default-clipLB-border"/></xsl:if>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   185
		<xsl:if test="contains($undefinedB,' box-clipLT ') or normalize-space($undefinedB)=''"><a:call-template name="default-clipLT-border"/></xsl:if>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   186
		<xsl:if test="contains($undefinedB,' box-clipRB ') or normalize-space($undefinedB)=''"><a:call-template name="default-clipRB-border"/></xsl:if>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   187
		<xsl:if test="contains($undefinedB,' box-clipRT ') or normalize-space($undefinedB)=''"><a:call-template name="default-clipRT-border"/></xsl:if>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   188
		<xsl:if test="contains($undefinedB,' box-clipAll ') or normalize-space($undefinedB)=''"><a:call-template name="default-clipAll-border"/></xsl:if>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   189
		<xsl:if test="contains($undefinedB,' round ')"><a:call-template name="default-round-border"/></xsl:if>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   190
		<xsl:if test="contains($undefinedB,' hexagon ')"><a:call-template name="default-hexagon-border"/></xsl:if>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   191
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   192
		<xsl:for-each select="document(@shapes)/shapes">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   193
			<xsl:copy-of select="s:defs/*"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   194
			<xsl:apply-templates select="borders|colors[@type!='background']|patterns" mode="defines"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   195
		</xsl:for-each>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   196
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   197
		
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   198
	</a:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   199
	
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   200
	<a:template match="*[@label-ref]" mode="eval-label">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   201
	<!-- next two lines are hacks to ensure this works if called accidently from a node-set or wrong file-->
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
   202
		<a:if test="not(ancestor::SystemDefinition) and @label"><a:value-of select="@label"/></a:if>
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
   203
		<a:if test="not(ancestor::SystemDefinition) and not(@label)"><a:value-of select="."/></a:if>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   204
		<a:variable name="id" select="@label-ref"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   205
		<xsl:variable name="abbrevs" select="document(/model/layout/info/@href,/)/display-names//abbrev"/> <!-- the abbreviations list -->
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
   206
		<a:for-each select="ancestor::SystemDefinition">
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   207
			<a:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   208
				<xsl:apply-templates mode="make-label-eval" select="//legend[contains(@label,'}') and not(@literal='yes' or @literal='true')]">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   209
					<xsl:with-param name="abbrevs" select="$abbrevs"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   210
				</xsl:apply-templates>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   211
				<xsl:apply-templates mode="make-label-eval" select="//note[contains(.,'}') and not(@literal='yes' or @literal='true')]">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   212
					<xsl:with-param name="abbrevs" select="$abbrevs"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   213
				</xsl:apply-templates>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   214
				<xsl:for-each select="document(layout/info/@href | @shapes,.)">
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
   215
					<xsl:apply-templates mode="make-label-eval" select="//*[(contains(@label,'}') and not(@literal='yes' or @literal='true')) or @count]">
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   216
						<xsl:with-param name="abbrevs" select="$abbrevs"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   217
					</xsl:apply-templates>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   218
					<xsl:apply-templates mode="make-label-eval" select="/shapes/examples/cmp[contains(text(),'}') and not(@literal='yes' or @literal='true')]">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   219
						<xsl:with-param name="abbrevs" select="$abbrevs"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   220
					</xsl:apply-templates>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   221
				</xsl:for-each>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   222
			</a:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   223
		</a:for-each>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   224
	</a:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   225
	</a:stylesheet>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   226
</xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   227
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
   228
<xsl:template mode="make-label-count" match="*"/>
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
   229
<xsl:template mode="make-label-count" match="*[@value and @count]"><xsl:param name="abbrevs"/>
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
   230
	<a:number format="{@count}">
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
   231
		<xsl:attribute name="value">count(key('use-<xsl:apply-templates select=".." mode="style-id"/>','<xsl:value-of select="@value"/>'))</xsl:attribute>	
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
   232
		<xsl:if test="$abbrevs/../@xml:lang">
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
   233
		  	<xsl:attribute name="lang"><xsl:value-of select="$abbrevs/../@xml:lang"/></xsl:attribute> 
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
   234
		</xsl:if>
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
   235
	</a:number>
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
   236
</xsl:template>
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
   237
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
   238
<xsl:template mode="make-label-count" match="*[@count and @rule]"><xsl:param name="abbrevs"/>
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
   239
	 <a:variable name="count">
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
   240
	  <a:apply-templates>
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
   241
	  	<xsl:attribute name="select">
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
   242
	  		<xsl:choose>
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
   243
			  	<xsl:when test="not(../@match)">//component</xsl:when> <!-- the default -->
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
   244
			  		<!-- this rest might not work in all cases -->
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
   245
			  	<xsl:when test="contains(../@match,'|')">
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
   246
			  		<!-- this is ugly and might actually break some cases: just prefix all pipe-separated bits by // -->
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
   247
			  		<xsl:text>//</xsl:text>
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
   248
					<xsl:call-template name="replace">
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
   249
						<xsl:with-param name="text" select="../@match"/>
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
   250
						<xsl:with-param name="from">|</xsl:with-param>
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
   251
						<xsl:with-param name="to">|//</xsl:with-param>
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
   252
					</xsl:call-template>
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
   253
				</xsl: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
   254
			  <xsl:otherwise>//<xsl:value-of select="../@match"/> <!-- should work, unless the path is something unexpected -->
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
   255
			  </xsl:otherwise>
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
   256
			 </xsl:choose>
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
   257
	  		</xsl:attribute> 
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
   258
	  	  <xsl:attribute name="mode">show-unused-<xsl:value-of select="concat(name(..),../@type)"/></xsl:attribute>
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
   259
		  <a:with-param name="n" select="$id"/>
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
   260
	  </a:apply-templates>
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
   261
	 </a:variable>
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
   262
	<a:number format="{@count}" value="string-length($count)">
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
   263
		<xsl:if test="$abbrevs/../@xml:lang">
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
   264
		  	<xsl:attribute name="lang"><xsl:value-of select="$abbrevs/../@xml:lang"/></xsl:attribute> 
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
   265
		</xsl:if>
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
   266
	</a:number>
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
   267
</xsl:template>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   268
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   269
<xsl:template mode="make-label-eval" match="*"><xsl:param name="abbrevs"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   270
	<a:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   271
		<xsl:attribute name="test">$id='<xsl:apply-templates select="." mode="style-id"/>'</xsl:attribute>
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
   272
		<xsl:if test="@literal='yes' or @literal='true'">
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
   273
			<xsl:call-template name="local-label"><xsl:with-param name="abbrevs" select="$abbrevs"/></xsl:call-template>
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
   274
		</xsl:if>
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
   275
		<xsl:if test="not(@literal='yes' or @literal='true')">
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
   276
			<xsl:call-template name="computed-label">
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
   277
				<xsl:with-param name="text">
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
   278
					<xsl:call-template name="local-label"><xsl:with-param name="abbrevs" select="$abbrevs"/></xsl:call-template>
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
   279
				</xsl:with-param>
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
   280
			</xsl:call-template>
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
   281
		</xsl:if>
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
   282
		<xsl:apply-templates mode="make-label-count" select=".">
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
   283
			<xsl:with-param name="abbrevs" select="$abbrevs"/>
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
   284
		</xsl:apply-templates>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   285
	</a:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   286
</xsl:template> 
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   287
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   288
<xsl:template name="local-label"><xsl:param name="abbrevs"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   289
	<xsl:variable name="val">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   290
		<xsl:value-of select="@label"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   291
		<xsl:if test="not(@label) and (self::cmp or self::note)"><xsl:value-of select="text()"/></xsl:if>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   292
	</xsl:variable>
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
   293
	<xsl:variable name="match" select="$abbrevs[@name=$val]"/> <!-- nothing will have an ID, so don't try to match -->
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   294
	<xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   295
		<xsl:when test="$match"><xsl:value-of select="$match/@abbrev"/></xsl:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   296
		<xsl:otherwise><xsl:value-of select="$val"/></xsl:otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   297
	</xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   298
</xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   299
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   300
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   301
<xsl:template name="computed-label">	<xsl:param name="text" select="@label"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   302
	<xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   303
		<xsl:when test="contains($text,'{')">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   304
			<a:text><xsl:value-of select="substring-before($text,'{')"/></a:text>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   305
			<xsl:variable name="eval" select="substring-before(substring-after($text,'{'),'}')"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   306
			<xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   307
				<xsl:when test="starts-with($eval,'@') and string-length($eval)=string-length(translate($eval,'=/ *()[]','')) "> <!-- if this passes, then this will generally just be an attribute -->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   308
					<a:apply-templates select="{$eval}" mode="as-text"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   309
				</xsl:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   310
				<xsl:otherwise><a:value-of select="{$eval}"/></xsl:otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   311
			</xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   312
			<xsl:call-template name="computed-label">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   313
				<xsl:with-param name="text" select="substring-after(substring-after($text,'{'),'}')"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   314
			</xsl:call-template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   315
		</xsl:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   316
		<xsl:when test="$text!=''"><a:text><xsl:value-of select="$text"/></a:text></xsl:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   317
	</xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   318
</xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   319
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
   320
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
   321
<xsl:template name="computed-values"><xsl:param name="text" select="@label"/><xsl:param name="join"> and </xsl:param>
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
   322
	<xsl:if test="contains($text,'{')">
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
   323
		<xsl:value-of select="substring-before(substring-after($text,'{'),'}')"/>
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
   324
		<xsl:if test="contains(substring-after(substring-after($text,'{'),'}'),'}')">
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
   325
			<xsl:value-of select="$join"/>
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
   326
			<xsl:call-template name="computed-values">
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
   327
				<xsl:with-param name="text" select="substring-after(substring-after($text,'{'),'}')"/>
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
   328
			</xsl:call-template>
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
   329
		</xsl:if>
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
   330
	</xsl:if>
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
   331
</xsl:template>
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
   332
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
   333
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
   334
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   335
<xsl:template match="/shapes">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   336
	<xsl:comment>Shapes</xsl:comment>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   337
	<xsl:for-each select="styles|colors|patterns|borders">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   338
		<xsl:if test="@use or not(*)">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   339
			<xsl:variable name="id"><xsl:apply-templates select="." mode="style-id"/></xsl:variable>	
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   340
		  <a:key name="{name()}-{$id}" match="group[@style-id='{$id}']/*" use="@lookup"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   341
		  	<xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   342
				<xsl:when test="@use">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   343
				  <a:key name="use-{$id}" >
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   344
				  	<xsl:copy-of select=" @use"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   345
				  	<xsl:call-template name="match-syntax"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   346
				  </a:key>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   347
				</xsl:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   348
			</xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   349
		</xsl:if>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   350
	</xsl:for-each>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   351
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
   352
	<xsl:if test="not($borders)"> <!-- borders must be defined in shapes.xml or values files, never both-->
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   353
		<xsl:apply-templates select="borders"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   354
	</xsl:if>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   355
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
   356
	<xsl:apply-templates select="colors"/>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   357
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
   358
	<xsl:apply-templates select="patterns"/>
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
   359
	<xsl:for-each select="patterns">
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
   360
		<a:template match="*" mode="overlay-{1 + count(preceding::patterns)}" priority="-8"/>
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
   361
		<a:template match="*" mode="show-unused-{name()}-{1 + count(preceding::patterns)}" priority="-8"/>
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
   362
	</xsl:for-each>
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
   363
	
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
   364
	<xsl:if test="patterns">
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
   365
		<a:template match="*" mode="overlays">
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
   366
			<xsl:for-each select="patterns">
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
   367
				<a:apply-templates select="." mode="overlay-{position()}"/>
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
   368
			</xsl:for-each>
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
   369
		</a:template>
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
   370
		<a:template match="*" mode="show-unused-patterns"><a:param name="n"/>
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
   371
			<xsl:for-each select="patterns[(not(@show-unused='yes') or (*/@count)) and */@rule]">
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
   372
				<a:apply-templates select="." mode="show-unused-{name(.)}-{count(preceding::patterns) + 1}">
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
   373
					<a:with-param name="n" select="$n"/>
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
   374
				</a:apply-templates>
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
   375
			</xsl:for-each>
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
   376
		</a:template>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   377
	</xsl:if>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   378
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   379
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   380
<!-- concatenate all default styles for legend items -->
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
   381
  <a:template match="cmp[not(@generated-style) and not(meta/generated-style)]" mode="display-style-aux">
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   382
		<xsl:for-each select="styles/style[not(@rule|@value)]"><xsl:value-of select="."/>;</xsl:for-each>    
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   383
  </a:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   384
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   385
<!-- create style attribute in the general case-->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   386
<a:template match="*" mode="display-style-aux">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   387
	<xsl:for-each select="styles">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   388
		<a:apply-templates select="." mode="display-style-{position()}"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   389
	</xsl:for-each>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   390
</a:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   391
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   392
	<!--  default to nothing for each style. This will be overriden later if necesssary -->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   393
	<xsl:for-each select="styles">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   394
		<a:template match="*" mode="display-style-{position()}"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   395
	</xsl:for-each>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   396
	
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   397
	<xsl:apply-templates select="styles"/>
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
   398
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
   399
	<xsl:for-each select="(borders|styles|patterns|colors)[(not(@show-unused='yes') and not(*/@rule) and *[@label and not(@value)]) ]">
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
   400
		<!-- check to see if labelled defaults of a look-up list are shown -->
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   401
		<a:template> <!-- default match is component -->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   402
			<xsl:call-template name="match-syntax"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   403
			<xsl:attribute name="mode">show-unused-<xsl:value-of select="concat(name(),@type)"/>
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
   404
				<xsl:if test="self::colors[not(@type)]">background</xsl:if>
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
   405
				<xsl:if test="self::patterns">-<xsl:value-of select="count(preceding-sibling::patterns) + 1"/></xsl:if>
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
   406
			</xsl:attribute>
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
   407
				<a:param name="n"/>
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
   408
			<a:if>
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
   409
			<xsl:attribute name="test"><xsl:text>not(</xsl:text>
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
   410
				<xsl:for-each select="*[@value]"><xsl:value-of select="../@use"/>='<xsl:value-of select="@value"/>'<xsl:if test="position()!=last()"> or </xsl:if></xsl:for-each>
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
   411
				<xsl:text>)</xsl:text>
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
   412
			</xsl:attribute>*</a:if>
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
   413
		</a:template>
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
   414
	</xsl:for-each>	
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
   415
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
   416
	<!-- only needed for options with rule. Options with lookup values are checked elsewhere -->
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
   417
	<xsl:for-each select="(borders|styles|patterns|colors)[(not(@show-unused='yes') or (*/@count)) and */@rule]">
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
   418
		<a:template> <!-- default match is component -->
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
   419
			<xsl:call-template name="match-syntax"/>
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
   420
			<xsl:attribute name="mode">show-unused-<xsl:value-of select="concat(name(),@type)"/>
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
   421
				<xsl:if test="self::colors[not(@type)]">background</xsl:if>
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
   422
				<xsl:if test="self::patterns">-<xsl:value-of select="count(preceding-sibling::patterns) + 1"/></xsl:if>
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
   423
			</xsl:attribute>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   424
				<a:param name="n"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   425
				<xsl:call-template name="declare-vars"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   426
			<a:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   427
				<xsl:for-each select="*[@rule]">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   428
					<a:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   429
						<xsl:attribute name="test"><xsl:apply-templates select="." mode="when-test"/></xsl:attribute>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   430
						<a:if>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   431
							<xsl:attribute name="test">$n='<xsl:apply-templates select="." mode="style-id"/>'</xsl:attribute>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   432
							<xsl:text>*</xsl:text>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   433
						</a:if>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   434
					</a:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   435
				</xsl:for-each>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   436
				<xsl:for-each select="*[not(@rule|@value)]">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   437
					<a:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   438
						<xsl:attribute name="test">$n='<xsl:apply-templates select="." mode="style-id"/>'</xsl:attribute>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   439
						<xsl:text>*</xsl:text>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   440
					</a:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   441
				</xsl:for-each>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   442
			</a:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   443
		</a:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   444
	</xsl:for-each>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   445
	
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   446
</xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   447
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   448
<!-- remove all quoted parens -->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   449
<xsl:template name="replace-quotes"><xsl:param name="text" select="."/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   450
	<xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   451
		<xsl:when test="contains($text,'&quot;')">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   452
			<xsl:value-of select="substring-before($text,'&quot;')"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   453
			<xsl:text> </xsl:text>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   454
			<xsl:value-of select="translate(substring-before(substring-after($text,'&quot;'),'&quot;'),'()','  ')"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   455
			<xsl:text> </xsl:text>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   456
			<xsl:call-template name="replace-quotes">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   457
				<xsl:with-param name="text" select="substring-after(substring-after($text,'&quot;'),'&quot;')"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   458
			</xsl:call-template>			
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   459
		</xsl:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   460
		<xsl:when test='contains($text,"&apos;")'>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   461
			<xsl:value-of select='substring-before($text,"&apos;")'/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   462
			<xsl:text> </xsl:text>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   463
			<xsl:value-of select='translate(substring-before(substring-after($text,"&apos;"),"&apos;"),"()","  ")'/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   464
			<xsl:text> </xsl:text>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   465
			<xsl:call-template name="replace-quotes">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   466
				<xsl:with-param name="text" select='substring-after(substring-after($text,"&apos;"),"&apos;")'/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   467
			</xsl:call-template>			
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   468
		</xsl:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   469
		<xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   470
	</xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   471
</xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   472
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
   473
<!-- replace all instances of $from with $to -->
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
   474
<xsl:template name="replace"><xsl:param name="text"/><xsl:param name="from"/><xsl:param name="to"/>
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
   475
	<xsl:choose>
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
   476
		<xsl:when test="contains($text,$from)">
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
   477
			<xsl:value-of select="substring-before($text,$from)"/>
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
   478
			<xsl:value-of select="$to"/>
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
   479
			<xsl:call-template name="replace">
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
   480
				<xsl:with-param name="text" select="substring-after($text,$from)"/>
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
   481
				<xsl:with-param name="from" select="$from"/>
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
   482
				<xsl:with-param name="to" select="$to"/>
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
   483
			</xsl:call-template>
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
   484
		</xsl: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
   485
		<xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise>
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
   486
	</xsl:choose>
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
   487
</xsl:template>
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
   488
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   489
<xsl:template name="param-length"><xsl:param name="text"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   490
<xsl:variable name="close-idx"  select="string-length(substring-before($text,')'))"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   491
<xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   492
	<xsl:when test="not(contains($text,')'))"><xsl:message terminate="yes">badly-formatted funtion: <xsl:value-of select="$text"/></xsl:message></xsl:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   493
	<xsl:when test="contains($text,'(')">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   494
		<xsl:variable name="open-idx"  select="string-length(substring-before($text,'('))"/>	
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   495
		<xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   496
			<xsl:when test="$close-idx &lt; $open-idx"><xsl:value-of select="$close-idx"/></xsl:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   497
			<xsl:otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   498
				<xsl:variable name="len">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   499
					<xsl:call-template name="param-length">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   500
						<xsl:with-param name="text" select="substring($text,2+$open-idx)"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   501
					</xsl:call-template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   502
				</xsl:variable>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   503
				<xsl:value-of select="2 + $open-idx + $len"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   504
			</xsl:otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   505
		</xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   506
	</xsl:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   507
	<xsl:otherwise><xsl:value-of select="$close-idx"/></xsl:otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   508
</xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   509
</xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   510
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   511
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
   512
<xsl:template name="need-current"><xsl:param name="arg"/>
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
   513
<xsl:variable name="bad">'/"</xsl:variable>
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
   514
	<xsl:if test="translate(substring($arg,1,1),$bad,'')!='' ">current()/</xsl:if>
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
   515
</xsl:template>
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
   516
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   517
<xsl:template name="replace-function"><xsl:param name="text" select="."/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   518
	<xsl:param name="function" select="'VERSION'"/>
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
   519
	<xsl:param name="before">count(exslt:node-set($Versions)/*[contains(concat(' ',.,' '),concat(' ',</xsl:param>
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
   520
	<xsl:param name="after">,' '))]/preceding-sibling::*)</xsl:param>
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
   521
	<xsl:param name="default">current()/ancestor::SystemDefinition/@ver</xsl:param>
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
   522
	<xsl:param name="need-current" select="1"/>
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
   523
	<xsl:param name="extra"/>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   524
	<xsl:variable name="func" select="concat($function,'(')"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   525
	<xsl:variable name="t">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   526
		<xsl:call-template name="replace-quotes">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   527
			<xsl:with-param name="text" select="$text"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   528
		</xsl:call-template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   529
	</xsl:variable>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   530
	<xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   531
		<xsl:when test="contains($t,$func)">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   532
			<xsl:value-of select="substring($text,1,string-length(substring-before($t,$func)))"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   533
			<xsl:variable name="pre" select="1 + string-length($func) + string-length(substring-before($t,$func))"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   534
			<xsl:variable name="a" select="substring($t,$pre)"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   535
			<xsl:variable name="r" select="substring($text,$pre)"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   536
			<xsl:variable name="len">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   537
				<xsl:call-template name="param-length">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   538
					<xsl:with-param name="text" select="$a"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   539
				</xsl:call-template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   540
			</xsl:variable>
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
   541
			<xsl:variable name="arg">
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
   542
				<xsl:if test="$need-current">
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
   543
					<xsl:call-template name="need-current">
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
   544
						<xsl:with-param name="arg" select="substring($r,1,$len)"/>
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
   545
					</xsl:call-template>
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
   546
			 	</xsl:if> <!-- this needs work -->
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
   547
			 	<xsl:value-of select="substring($r,1,$len)"/>
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
   548
			 </xsl:variable>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   549
				<xsl:value-of select="$before"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   550
				<xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   551
					<xsl:when test="normalize-space($arg)=''"><xsl:value-of select="$default"/></xsl:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   552
					<xsl:otherwise><xsl:value-of select="$arg"/></xsl:otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   553
				</xsl:choose>
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
   554
				<xsl:value-of select="$extra"/>
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
   555
				<xsl:choose>
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
   556
					<xsl:when test="$extra =''"/>
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
   557
					<xsl:when test="normalize-space($arg)=''"><xsl:value-of select="$default"/></xsl: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
   558
					<xsl:otherwise><xsl:value-of select="$arg"/></xsl:otherwise>
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
   559
				</xsl:choose>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   560
				<xsl:value-of select="$after"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   561
				<xsl:call-template name="replace-function">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   562
					<xsl:with-param name="text" select="substring($r,$len+2)"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   563
					<xsl:with-param name="function" select="$function"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   564
					<xsl:with-param name="before" select="$before"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   565
					<xsl:with-param name="default" select="$default"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   566
					<xsl:with-param name="after" select="$after"/>
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
   567
					<xsl:with-param name="need-current" select="$need-current"/>
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
   568
					<xsl:with-param name="extra" select="$extra"/>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   569
				</xsl:call-template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   570
		</xsl:when>	
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   571
		<xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise>		
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   572
	</xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   573
</xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   574
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   575
<xsl:template match="*[@rule]" mode="varname"><xsl:value-of select="name()"/>-var-<xsl:value-of select="count(preceding::*[@variable])"/></xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   576
<xsl:template match="*/@rule"><xsl:param name="text" select="."/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   577
	<xsl:variable name="fixed0">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   578
		<xsl:call-template name="replace-function">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   579
			<xsl:with-param name="text" select="$text"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   580
		</xsl:call-template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   581
	</xsl:variable>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   582
	<xsl:variable name="fixed1">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   583
		<xsl:call-template name="replace-function">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   584
			<xsl:with-param name="text" select="$fixed0"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   585
			<xsl:with-param name="function">CLASS</xsl:with-param>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   586
			<xsl:with-param name="before">contains(concat(' ',normalize-space(@class),' '),concat(' ',</xsl:with-param>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   587
			<xsl:with-param name="default">1</xsl:with-param>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   588
			<xsl:with-param name="after">,' '))</xsl:with-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
   589
			<xsl:with-param name="need-current" select="0"/>
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
   590
		</xsl:call-template>
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
   591
	</xsl:variable>
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
   592
	<xsl:variable name="fixed2">
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
   593
		<xsl:call-template name="replace-function">
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
   594
			<xsl:with-param name="text" select="$fixed1"/>
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
   595
			<xsl:with-param name="function">NAMESPACE</xsl:with-param>
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
   596
			<xsl:with-param name="before">concat(ancestor-or-self::*/namespace::*[name()=substring-before(</xsl:with-param>
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
   597
			<xsl:with-param name="extra">,':')],ancestor::SystemDefinition/@id-namespace[not(contains(</xsl:with-param>
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
   598
			<xsl:with-param name="default">''</xsl:with-param>
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
   599
			<xsl:with-param name="after">,':'))])</xsl:with-param>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   600
		</xsl:call-template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   601
	</xsl:variable>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   602
	<xsl:variable name="fixed">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   603
		<xsl:call-template name="replace-function">
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
   604
			<xsl:with-param name="text" select="$fixed2"/>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   605
			<xsl:with-param name="function">VARIABLE</xsl:with-param>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   606
			<xsl:with-param name="before"></xsl:with-param>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   607
			<xsl:with-param name="default">$<xsl:apply-templates select=".." mode="varname"/></xsl:with-param>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   608
			<xsl:with-param name="after"></xsl:with-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
   609
			<xsl:with-param name="need-current" select="0"/>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   610
		</xsl:call-template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   611
	</xsl:variable>
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
   612
	<xsl:value-of select="$fixed"/>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   613
</xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   614
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   615
<!--=========== basic SVG definitions ==============-->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   616
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   617
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   618
<xsl:template match="color" mode="id">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   619
	<xsl:value-of select="concat(../@type,count(preceding::color[../@type]))"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   620
</xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   621
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   622
<xsl:template match="overlay" mode="id">Pattern<xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   623
		<xsl:when test="@type"><xsl:value-of select="@type"/></xsl:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   624
		<xsl:otherwise>Overlay<xsl:value-of select="count(preceding::overlay)"/></xsl:otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   625
	</xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   626
</xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   627
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   628
<xsl:template match="border" mode="id">Border<xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   629
		<xsl:when test="@type"><xsl:value-of select="@type"/></xsl:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   630
		<xsl:otherwise>Shape<xsl:value-of select="count(preceding::border)"/></xsl:otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   631
	</xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   632
</xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   633
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   634
<!-- can explictly reference self-defined pattern or border: chop off starting #  -->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   635
<xsl:template match="*[starts-with(@type,'#')]" mode="id" priority="1"><xsl:value-of select="substring(@type,2)"/></xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   636
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   637
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   638
<xsl:template match="border[@value] | color[@value] | overlay[@value] | style[@value]" mode="when-test">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   639
	<xsl:if test="not(../@use)">.</xsl:if>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   640
	<xsl:value-of select="../@use"/>='<xsl:value-of select="@value"/>'</xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   641
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   642
<xsl:template match="border[@rule] |color[@rule] | overlay [@rule]  | style[@rule]" mode="when-test">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   643
	<xsl:variable name="rule"><xsl:apply-templates select="@rule"/></xsl:variable>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   644
	<xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   645
		<xsl:when test="../@use">(<xsl:value-of select="../@use"/>)[<xsl:value-of select="$rule"/>]</xsl:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   646
		<xsl:otherwise><xsl:value-of select="$rule"/></xsl:otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   647
	</xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   648
</xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   649
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   650
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   651
<xsl:template match="borders" mode="defines">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   652
	<!-- make symbols for all the (unique) borders -->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   653
	<xsl:for-each select="border">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   654
		<xsl:if test="not(@type)">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   655
			<symbol>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   656
				<xsl:attribute name="id"><xsl:apply-templates select="." mode="id"/></xsl:attribute>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   657
				<xsl:apply-templates select="." mode="model"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   658
			</symbol>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   659
		</xsl:if>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   660
	</xsl:for-each>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   661
	
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   662
	<xsl:if test="$Verbose">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   663
		<xsl:if test="not(border[not(@value|@rule)])"><xsl:message>&#xa;warning: no default border</xsl:message></xsl:if>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   664
		<xsl:if test="count(border[not(@value|@rule)]) &gt; 1 "><xsl:message>&#xa;error: more than one default border</xsl:message></xsl:if>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   665
	</xsl:if>	
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   666
</xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   667
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   668
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   669
<xsl:template match="patterns" mode="defines">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   670
	<!-- make symbols for all the (unique) overlays -->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   671
 	<xsl:for-each select="*"> 	
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   672
		<xsl:if test="count(self::overlay/*) &gt; 1 "><xsl:message>&#xa;error: more than one pattern in overlay</xsl:message></xsl:if>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   673
		<xsl:for-each select="self::*[not(@type)]/*[1]"> <!--  should only be one -->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   674
			<xsl:copy><xsl:copy-of select="@*"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   675
				<xsl:attribute name="id"><xsl:apply-templates select=".." mode="id"/></xsl:attribute>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   676
				<xsl:copy-of select="*"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   677
			</xsl:copy>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   678
		</xsl:for-each>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   679
	</xsl:for-each>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   680
	
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   681
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   682
	<xsl:if test="count(*[not(@value|@rule)]) &gt; 1 "><xsl:message>&#xa;error: more than one default <xsl:value-of select="name(*)"/></xsl:message></xsl:if>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   683
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   684
</xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   685
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   686
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   687
<xsl:template match="border" mode="model">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   688
	<xsl:copy-of select="@viewBox|*"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   689
</xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   690
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   691
<!-- Borders -->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   692
<xsl:template match="borders">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   693
		<!-- add attributes to s:use element -->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   694
		<a:template mode="shape" match="component">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   695
			<!-- <xsl:call-template name="match-syntax"/> only applies to components -->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   696
			<xsl:call-template name="declare-vars"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   697
			<xsl:variable name="id"><xsl:apply-templates select="." mode="style-id"/></xsl:variable>	
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   698
			<xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   699
				<xsl:when test="@use and not(border[@rule])">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   700
					<!-- no borders with rules, should all be default or value -->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   701
				      <a:variable name="c" select="key('{name()}-{$id}',{@use})/@value"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   702
				  	  <a:value-of select="$c"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   703
			         <a:if test="not($c)">#<xsl:apply-templates select="border[not(@value)][1]" mode="id"/></a:if>					
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   704
				</xsl:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   705
				<xsl:when test="border[@rule]">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   706
					<!-- at least one border has a rule -->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   707
					<a:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   708
						<xsl:for-each select="border[@rule]">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   709
							<a:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   710
								<xsl:attribute name="test"><xsl:apply-templates select="." mode="when-test"/></xsl:attribute>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   711
								<xsl:text>#</xsl:text>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   712
								<xsl:apply-templates select="." mode="id"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   713
							</a:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   714
						</xsl:for-each>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   715
						<a:otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   716
							<xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   717
								<xsl:when test="@use">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   718
						      			<a:variable name="c" select="key('{name()}-{$id}',{@use})/@value"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   719
						  	  		<a:value-of select="$c"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   720
					         				<a:if test="not($c)">#<xsl:apply-templates select="border[not(@value)][1]" mode="id"/></a:if>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   721
					         			</xsl:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   722
					         			<xsl:when test="border[not(@value)]">#<xsl:apply-templates select="border[not(@value)][1]" mode="id"/></xsl:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   723
					         		</xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   724
						</a:otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   725
					</a:choose> 
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   726
				</xsl:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   727
					<!-- no rules and no @use, must just have a single default -->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   728
				<xsl:when test="border[not(@value)]">#<xsl:apply-templates select="border[not(@value)][1]" mode="id"/></xsl:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   729
			</xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   730
		</a:template>			
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   731
		<xsl:if test="border[not(@value)]">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   732
			<a:template match="cmp" mode="shape">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   733
				<xsl:text>#</xsl:text><xsl:apply-templates select="border[not(@value)][1]" mode="id"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   734
			</a:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   735
		</xsl:if>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   736
</xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   737
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   738
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   739
<!-- Colours -->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   740
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   741
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   742
<xsl:template match="colors[@type='highlight']" mode="defines">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   743
	<xsl:for-each select="color">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   744
		<xsl:variable name="id"><xsl:apply-templates select="." mode="id"/></xsl:variable>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   745
		<filter id="{$id}" filterUnits="userSpaceOnUse">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   746
	  		<feGaussianBlur in="SourceAlpha" stdDeviation="4" result="blur"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   747
	  		<feFlood flood-color="{@color}" flood-opacity="1" result="flood"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   748
			<feComposite in2="blur" in="flood" operator="atop" result="comp" />
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   749
	  		<feMerge>    
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   750
	  	  		<feMergeNode in="comp"/><feMergeNode in="SourceGraphic"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   751
	  		</feMerge>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   752
		</filter>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   753
	</xsl:for-each>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   754
</xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   755
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   756
<xsl:template match="colors[@type='text-highlight']" mode="defines">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   757
	<xsl:for-each select="color">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   758
		<xsl:variable name="id"><xsl:apply-templates select="." mode="id"/></xsl:variable>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   759
		<filter id="{$id}" filterUnits="userSpaceOnUse">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   760
			<feMorphology operator="dilate" in="SourceAlpha" radius="0.2" result="blur"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   761
		 	<!-- <feGaussianBlur in="SourceAlpha" stdDeviation="0.8" result="blur"/> -->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   762
			<feFlood flood-color="{@color}" flood-opacity="1" result="flood"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   763
			<feComposite in2="blur" in="flood" operator="atop" result="comp" />
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   764
			<feMerge><feMergeNode in="comp"/><feMergeNode in="SourceGraphic"/></feMerge>	
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   765
		</filter>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   766
	</xsl:for-each>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   767
</xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   768
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   769
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   770
<xsl:template match="colors">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   771
	<a:template mode="{substring-before(@type,'highlight')}filter">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   772
		<xsl:call-template name="match-syntax"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   773
		<xsl:call-template name="declare-vars"/>	
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   774
		<a:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   775
		<xsl:for-each select="color[@value|@rule]">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   776
			<a:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   777
				<xsl:attribute name="test"><xsl:apply-templates select="." mode="when-test"/></xsl:attribute>			
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   778
				<a:attribute name="filter">url(#<xsl:apply-templates select="." mode="id"/>)</a:attribute>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   779
			</a:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   780
		</xsl:for-each>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   781
		<xsl:for-each select="color[not(@value|@rule)]">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   782
				<a:otherwise><a:attribute name="filter">url(#<xsl:apply-templates select="." mode="id"/>)</a:attribute></a:otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   783
		</xsl:for-each>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   784
		</a:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   785
	</a:template>		
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   786
</xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   787
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   788
<xsl:template name="color-select">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   789
  <xsl:param name="default"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   790
  <xsl:variable name="id"><xsl:apply-templates select="." mode="style-id"/></xsl:variable>  
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
   791
  <a:variable name="c" select="key('{name()}-{$id}',{@use})/@value"/>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   792
  <a:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   793
    <a:when test="not($c)"><xsl:value-of select="$default"/></a:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   794
    <a:when test="count($c)=1"><a:value-of select="$c"/></a:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   795
    <a:otherwise>url(#bg<a:apply-templates select="." mode="id"/>)</a:otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   796
  </a:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   797
</xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   798
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   799
<xsl:template match="colors[@type='background' or not(@type)]" priority="1">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   800
	<xsl:variable name="default-color">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   801
		<xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   802
			<xsl:when test="color[not(@value|@rule)]"><xsl:value-of select="color[not(@value|@rule)]/@color"/></xsl:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   803
			<xsl:otherwise><xsl:value-of select="@default"/></xsl:otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   804
		</xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   805
	</xsl:variable>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   806
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   807
<!--  possible future enhancements: 
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   808
	computed colour: expression to generate a comma-separated rgb tripple to be put inside "rgb(...)"  -->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   809
	
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
   810
    <xsl:if test="@use">
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   811
<!--    multiple colours: if there are multiple match they'll appear as a gradient-->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   812
	<a:template mode="multi-color">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   813
    	<xsl:call-template name="match-syntax"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   814
			<xsl:variable name="key"><xsl:value-of select="name()"/>-<xsl:apply-templates select="." mode="style-id"/></xsl:variable>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   815
			<a:call-template name="multi-color-grad">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   816
			<xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   817
				<xsl:when test="@spacing='proportional'"> <!-- as opposed to the default: fixed -->
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
   818
					<a:with-param name="c" select="key('{$key}',{@use})/@value"/>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   819
          		</xsl:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   820
				<xsl:otherwise>          		
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   821
					<a:with-param name="key" select="'{$key}'"/>
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
   822
					<a:with-param name="c" select="{@use}"/>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   823
				</xsl:otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   824
			</xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   825
          	<a:with-param name="dir" select="'{@direction}'" /> <!--  not documented! only used for XSLT processors that can't handle sin / cos -->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   826
          	<a:with-param name="angle" select="'{@angle}'" />
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   827
          	<a:with-param name="blur">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   828
          		<xsl:attribute name="select">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   829
          			<xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   830
          				<xsl:when test="not(@blur)">0</xsl:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   831
          				<xsl:otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   832
          					<xsl:value-of select="0.5 * 100 * @blur"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   833
          				</xsl:otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   834
          			</xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   835
          		</xsl:attribute>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   836
          	</a:with-param>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   837
          </a:call-template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   838
    </a:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   839
    </xsl:if>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   840
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   841
	<a:template mode="display-style-color">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   842
		<xsl:call-template name="match-syntax"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   843
		<xsl:call-template name="declare-vars"/>	
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   844
		<xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   845
			<xsl:when test="@use and not(color[@rule])">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   846
                  <xsl:call-template name="color-select">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   847
                    <xsl:with-param name="default" select="$default-color"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   848
                  </xsl:call-template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   849
			</xsl:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   850
			<xsl:otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   851
				<a:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   852
					<xsl:for-each select="color[@rule]">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   853
						<a:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   854
							<xsl:attribute name="test"><xsl:apply-templates select="." mode="when-test"/></xsl:attribute>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   855
							<xsl:value-of select="@color"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   856
						</a:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   857
					</xsl:for-each>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   858
					<a:otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   859
						<xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   860
							<xsl:when test="@use"> <!-- only useful if there's something to look up -->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   861
                                <xsl:call-template name="color-select">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   862
                                  <xsl:with-param name="default" select="$default-color"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   863
                                </xsl:call-template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   864
					        </xsl:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   865
					        <xsl:otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   866
					        	<xsl:value-of select="$default-color"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   867
					        </xsl:otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   868
					       </xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   869
					</a:otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   870
				</a:choose> 
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   871
			</xsl:otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   872
		</xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   873
	</a:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   874
	
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   875
	<xsl:if test="(@type='background' or not(@type)) and $default-color!=''">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   876
		<a:template match="cmp" mode="display-style-color">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   877
			<xsl:value-of select="$default-color"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   878
		</a:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   879
	</xsl:if>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   880
	
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   881
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   882
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   883
	<a:template mode="animate-color">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   884
		<xsl:call-template name="match-syntax"/>
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
   885
		<a:if test="not(ancestor::SystemDefinition/@static='true')">
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   886
		<xsl:call-template name="declare-vars"/>	
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   887
		<xsl:variable name="id"><xsl:apply-templates select="." mode="style-id"/></xsl:variable>	
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   888
		<xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   889
			<xsl:when test="@use and not(color[@rule])">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   890
				<a:for-each select="key('{name()}-{$id}',{@use})">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   891
					<set attributeName="opacity" attributeType="XML" to="0.5" fill="remove">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   892
						<xsl:attribute name="begin">{@style-id}.mouseover</xsl:attribute>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   893
						<xsl:attribute name="end">{@style-id}.mouseout</xsl:attribute>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   894
					</set>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   895
				</a:for-each>			
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   896
			</xsl:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   897
			<xsl:when test="not(*) and @match='@ts'">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   898
				<a:for-each select="key('{name()}-{$id}',@ts)">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   899
					<set attributeName="opacity" attributeType="XML" to="0.5" fill="remove">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   900
						<xsl:attribute name="begin">{@style-id}.mouseover</xsl:attribute>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   901
						<xsl:attribute name="end">{@style-id}.mouseout</xsl:attribute>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   902
					</set>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   903
				</a:for-each>			
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   904
			</xsl:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   905
			<xsl:otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   906
				<a:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   907
					<xsl:for-each select="color[@rule]">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   908
						<a:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   909
							<xsl:attribute name="test"><xsl:apply-templates select="." mode="when-test"/></xsl:attribute>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   910
								<set attributeName="opacity" attributeType="XML" to="0.5" fill="remove">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   911
									<xsl:attribute name="begin"><xsl:apply-templates select="." mode="style-id"/>.mouseover</xsl:attribute>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   912
									<xsl:attribute name="end"><xsl:apply-templates select="." mode="style-id"/>.mouseout</xsl:attribute>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   913
								</set>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   914
						</a:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   915
					</xsl:for-each>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   916
					<xsl:if test="@use"> <!-- only useful if there's something to look up -->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   917
						<a:otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   918
							<a:for-each select="key('{name()}-{$id}',{@use})">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   919
								<set attributeName="opacity" attributeType="XML" to="0.5" fill="remove">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   920
									<xsl:attribute name="begin">{@style-id}.mouseover</xsl:attribute>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   921
									<xsl:attribute name="end">{@style-id}.mouseout</xsl:attribute>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   922
								</set>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   923
							</a:for-each>		
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   924
						</a:otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   925
					</xsl:if>						
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   926
				</a:choose> 
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   927
			</xsl:otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   928
		</xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   929
	</a:if>	
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   930
	</a:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   931
		
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   932
		
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   933
</xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   934
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   935
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   936
<xsl:template match="patterns">
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
   937
	<a:template mode="overlay-{1 + count(preceding::patterns)}">
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   938
	 	<xsl:call-template name="match-syntax"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   939
		<xsl:call-template name="declare-vars"/>	
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
   940
		<a:choose>
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
   941
			<xsl:for-each select="overlay">
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
   942
				<a: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
   943
					<xsl:attribute name="test">
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
   944
						<xsl:apply-templates select="." mode="when-test"/>
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
   945
					</xsl:attribute><o>#<xsl:apply-templates mode="id" select="."/></o></a: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
   946
			</xsl:for-each>
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
   947
		</a:choose>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   948
	</a:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   949
</xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   950
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   951
<xsl:template name="declare-vars">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   952
	<xsl:for-each select="*[@variable]">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   953
		<a:variable>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   954
			<xsl:attribute name="name"><xsl:apply-templates select="." mode="varname"/></xsl:attribute>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   955
			<xsl:attribute name="select"><xsl:value-of select="@variable"/></xsl:attribute>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   956
		</a:variable>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   957
	</xsl:for-each>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   958
</xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   959
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   960
<xsl:template match="styles">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   961
	<a:template mode="display-style-{position()}">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   962
	  	<xsl:call-template name="match-syntax"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   963
		<!--  set any necessary variables -->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   964
		<xsl:call-template name="declare-vars"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   965
		<a:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   966
			<xsl:for-each select="style[@rule]">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   967
				<a:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   968
					<xsl:attribute name="test"><xsl:apply-templates select="." mode="when-test"/></xsl:attribute>				
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   969
					<xsl:value-of select="."/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   970
				</a:when>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   971
			</xsl:for-each>
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
   972
			<xsl:for-each select="style[not(@rule|@value)]"> <!--  the default is last (if it exists)-->
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   973
				<a:otherwise><xsl:value-of select="."/></a:otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   974
			</xsl:for-each>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   975
		</a:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   976
		<a:text>; </a:text>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   977
</a:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   978
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   979
</xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   980
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   981
<xsl:template name="match-syntax">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   982
	<xsl:choose>
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
   983
			<xsl:when test="not(@match)"><xsl:attribute name="match">component</xsl:attribute></xsl:when>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   984
			<xsl:when test="@match='module'"><xsl:attribute name="match">collection</xsl:attribute></xsl: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
   985
			<xsl:when test="@match='logicalset' or @match='block'"><xsl:attribute name="match">package</xsl:attribute></xsl: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
   986
			<xsl:when test="@match='logicalsubset' or @match='subblock'"><xsl:attribute name="match">package/package</xsl:attribute></xsl:when>
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   987
			<xsl:otherwise><xsl:copy-of select="@match"/></xsl:otherwise>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   988
	</xsl:choose>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   989
</xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   990
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
   991
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   992
<!--  from model.xsl:  -->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   993
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   994
<xsl:template match="*" mode="style-id">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   995
<xsl:message>not found</xsl:message>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   996
</xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
   997
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
   998
<xsl:template match="item" mode="style-id">
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
   999
	<xsl:message>Generated Text not supported in values files</xsl:message>
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
  1000
</xsl:template>
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
  1001
1
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
  1002
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
  1003
<xsl:template match="info" mode="style-id">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
  1004
	<xsl:value-of select="concat('i',count(preceding-sibling::info))"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
  1005
</xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
  1006
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
  1007
<xsl:template match="legend" mode="style-id">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
  1008
	<xsl:value-of select="concat('L',count(preceding::legend))"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
  1009
</xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
  1010
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
  1011
<xsl:template match="note" mode="style-id">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
  1012
	<xsl:value-of select="concat('n',count(preceding::note))"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
  1013
</xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
  1014
	
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
  1015
<!-- what about values and items? -->
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
  1016
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
  1017
<xsl:template match="colors|borders|patterns|styles|examples" mode="style-id">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
  1018
	<xsl:value-of select="concat('s',count(preceding-sibling::*))"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
  1019
</xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
  1020
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
  1021
<xsl:template match="colors/color|borders/border|patterns/overlay|styles/style" mode="style-id">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
  1022
	<xsl:apply-templates select=".." mode="style-id"/>-<xsl:value-of select="name()"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
  1023
	<xsl:value-of select="count(preceding-sibling::*)"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
  1024
</xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
  1025
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
  1026
<xsl:template match="examples/cmp" mode="style-id">
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
  1027
	<xsl:value-of select="concat('e',count(preceding::cmp[parent::examples]))"/>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
  1028
</xsl:template>
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
  1029
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
  1030
b538b70cbe51 Move rest of the swconfigmdw package components to oss repository.
terytkon
parents:
diff changeset
  1031
</xsl:stylesheet>