sysmodelgen/core/overlay-module.xsl
author William Roberts <williamr@symbian.org>
Wed, 05 May 2010 16:05:16 +0100
branchHighFidelityModel
changeset 196 b63fe30d6d26
parent 152 5acf50bbb618
permissions -rw-r--r--
Reinstate "removed components" in os/lbs which are still present and needed in wk17 drop of S^3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
152
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     1
<?xml version="1.0"?>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     2
 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     3
 	<xsl:output method="xml" indent="yes"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     4
	<xsl:key name="named" match="*" use="@name"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     5
 
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     6
<xsl:template match="sysdef" mode="overlay-attributes" priority="1">  <xsl:param name="item"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     7
	<xsl:choose>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     8
		<xsl:when test="$item[self::SystemDefinition]">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     9
			<!--  add global attribtues to document node since we canalways easily find it -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    10
			<xsl:apply-templates select="/model" mode="global-attributes"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    11
		</xsl:when>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    12
		<xsl:when test="$item/@id">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    13
			<!-- follwing vars to save trouble of recalulating each time -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    14
			<xsl:variable name="id"><xsl:apply-templates select="$item/@id" mode="my-id"/></xsl:variable>			<!-- namespaceless ID of this here -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    15
			<xsl:variable name="ns"><xsl:apply-templates select="$item/@id" mode="my-namespace"/></xsl:variable>	<!-- ID's namespace -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    16
			<xsl:apply-templates select="info|../layout/*" mode="overlay-attributes">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    17
				<xsl:with-param name="id" select="$id"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    18
				<xsl:with-param name="ns" select="$ns"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    19
				<xsl:with-param name="item" select="$item"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    20
			</xsl:apply-templates>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    21
		</xsl:when>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    22
	</xsl:choose>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    23
</xsl:template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    24
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    25
<xsl:template match="sysdef" mode="overlay-meta" priority="1"><xsl:param name="item"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    26
	<xsl:if test="$item[parent::SystemDefinition]">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    27
		<!-- the root model item gets the global meta stuff -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    28
		<xsl:apply-templates select="/model" mode="global-meta"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    29
	</xsl:if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    30
	<xsl:if test="$item/@id">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    31
		<!-- follwing vars to save trouble of recalulating each time -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    32
		<xsl:variable name="id"><xsl:apply-templates select="$item/@id" mode="my-id"/></xsl:variable>			<!-- namespaceless ID of this here -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    33
		<xsl:variable name="ns"><xsl:apply-templates select="$item/@id" mode="my-namespace"/></xsl:variable>	<!-- ID's namespace -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    34
		<xsl:apply-templates select="info|../layout/info|document(../@deps,.)/*" mode="overlay-meta">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    35
			<xsl:with-param name="id" select="$id"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    36
			<xsl:with-param name="ns" select="$ns"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    37
			<xsl:with-param name="item" select="$item"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    38
		</xsl:apply-templates>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    39
	</xsl:if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    40
</xsl:template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    41
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    42
<xsl:template match="*" mode="global-meta"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    43
<xsl:template match="/model" mode="global-meta">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    44
	<xsl:apply-templates select="*[not(self::sysdef)]" mode="global-meta"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    45
</xsl:template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    46
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    47
<xsl:template match="* | @*" mode="global-attributes"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    48
<xsl:template match="/model" mode="global-attributes">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    49
	<xsl:apply-templates select="*[not(self::sysdef)] | @*" mode="global-attributes"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    50
</xsl:template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    51
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    52
<xsl:template mode="global-attributes" match="@version | /model/@*">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    53
	<xsl:copy-of select="."/> 
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    54
</xsl:template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    55
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    56
<xsl:template mode="global-attributes" match="/model/@link">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    57
	<xsl:attribute name="base"><xsl:value-of select="."/></xsl:attribute>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    58
</xsl:template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    59
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    60
<xsl:template mode="global-attributes" match="/SystemModelDeps/@name"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    61
<xsl:template mode="global-attributes" match="/SystemModelDeps/@number">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    62
	<xsl:attribute name="build"><xsl:value-of select="."/></xsl:attribute>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    63
</xsl:template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    64
<xsl:template mode="global-attributes" match="/model/@deps">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    65
	<xsl:apply-templates select="document(.,.)/*/@*" mode="global-attributes"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    66
</xsl:template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    67
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    68
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    69
<xsl:template match="/info" mode="overlay-meta" priority="2">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    70
	<xsl:param name="ns"/><xsl:param name="id"/><xsl:param name="from"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    71
	<xsl:for-each select="item[@ref and (@ref=$id or substring-after(@ref,':')=$id)]"> <!-- potential match of IDs -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    72
		<xsl:variable name="myns"><xsl:apply-templates select="@ref" mode="my-namespace"/></xsl:variable>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    73
		<xsl:if test="$myns = $ns"> <!-- match -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    74
			<meta><xsl:apply-templates select="/info/@data-type" mode="overlay-meta"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    75
				<xsl:if test="not(/info/@data-type)"><xsl:copy-of select="$from/@rel | $from/@type[.!='extra']"/></xsl:if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    76
				<xsl:copy-of select="*|comment()"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    77
			</meta>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    78
		</xsl:if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    79
	</xsl:for-each>	
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    80
</xsl:template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    81
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    82
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    83
<xsl:template match="info[@type='abbrev']" mode="overlay-meta" priority="2"/> <!-- only sets attributes, never content -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    84
<xsl:template match="info[@href]" mode="overlay-meta" priority="1"><xsl:param name="item"/><xsl:param name="ns"/><xsl:param name="id"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    85
	<xsl:apply-templates select="document(@href,.)/*" mode="overlay-meta">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    86
		<xsl:with-param name="id" select="$id"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    87
		<xsl:with-param name="ns" select="$ns"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    88
		<xsl:with-param name="item" select="$item"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    89
		<xsl:with-param name="from" select="current()"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    90
	</xsl:apply-templates>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    91
</xsl:template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    92
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    93
<xsl:template match="info[@href]" mode="overlay-attributes" priority="1"><xsl:param name="item"/><xsl:param name="ns"/><xsl:param name="id"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    94
	<xsl:apply-templates select="document(@href,.)/*" mode="overlay-attributes">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    95
		<xsl:with-param name="id" select="$id"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    96
		<xsl:with-param name="ns" select="$ns"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    97
		<xsl:with-param name="item" select="$item"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    98
		<xsl:with-param name="from" select="current()"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    99
	</xsl:apply-templates>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   100
</xsl:template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   101
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   102
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   103
<!-- generic info syntax for attaching data to IDs --> 
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   104
<xsl:template match="/info" mode="overlay-meta" priority="2">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   105
	<xsl:param name="ns"/><xsl:param name="id"/><xsl:param name="from"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   106
	<xsl:for-each select="item[@ref and (@ref=$id or substring-after(@ref,':')=$id)]"> <!-- potential match of IDs -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   107
		<xsl:variable name="myns"><xsl:apply-templates select="@ref" mode="my-namespace"/></xsl:variable>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   108
		<xsl:if test="$myns = $ns"> <!-- match -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   109
			<xsl:copy-of select="meta[count(@rel|@type)=count(@*)]"/> <!--copy all standard meta sections verbatim and first -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   110
			<xsl:if test="*[not(self::meta[count(@rel|@type)=count(@*)])]">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   111
				<!-- anything not in a meta will be put in a generic meta, comments inclued. --> 
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   112
				<meta><xsl:apply-templates select="/info/@data-type" mode="overlay-meta"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   113
					<xsl:if test="not(/info/@data-type)"><xsl:copy-of select="$from/@rel | $from/@type[.!='extra']"/></xsl:if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   114
					<xsl:copy-of select="*[not(self::meta[count(@rel|@type)=count(@*)])]|comment()"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   115
				</meta>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   116
			</xsl:if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   117
		</xsl:if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   118
	</xsl:for-each>	
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   119
</xsl:template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   120
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   121
<xsl:template match="/info" mode="overlay-attributes" priority="2">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   122
	<xsl:param name="ns"/><xsl:param name="id"/><xsl:param name="from"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   123
	<xsl:for-each select="item[@ref and (@ref=$id or substring-after(@ref,':')=$id)]"> <!-- potential match of IDs -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   124
		<xsl:variable name="myns"><xsl:apply-templates select="@ref" mode="my-namespace"/></xsl:variable>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   125
		<xsl:if test="$myns = $ns"> <!-- match -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   126
			<xsl:copy-of select="@*[name()!='id' and name()!='ref' ]"/> <!-- cannot override ID, don't include ref -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   127
		</xsl:if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   128
	</xsl:for-each>	
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   129
</xsl:template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   130
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   131
<xsl:template match="/info/@data-type" mode="overlay-meta">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   132
	<xsl:attribute name="rel"><xsl:value-of select="."/></xsl:attribute>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   133
</xsl:template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   134
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   135
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   136
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   137
<!-- S12 is well deprecated, but should still support for now. Note that use of osd attribute is slightly different from before --> 
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   138
<xsl:template match="/Schedule12" mode="overlay-meta">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   139
	<xsl:param name="ns"/><xsl:param name="id"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   140
	<xsl:for-each select="//system_model[@entry=$id or substring-after(@entry,':')=$id]"> <!-- potential match of IDs -->	
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   141
		<xsl:variable name="myns"><xsl:apply-templates select="@entry" mode="my-namespace"/></xsl:variable>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   142
		<xsl:if test="$myns = $ns"> <!-- match -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   143
			<meta rel="Schedule12">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   144
				<s12>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   145
					<xsl:attribute name="ver"><xsl:value-of select="/Schedule12/@OS_version"/></xsl:attribute>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   146
					<xsl:attribute name="osd"><xsl:value-of select="name(..)"/></xsl:attribute>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   147
					<xsl:copy-of select="@name"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   148
				</s12>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   149
			</meta>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   150
		</xsl:if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   151
	</xsl:for-each>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   152
</xsl:template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   153
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   154
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   155
<xsl:template match="/SystemModelDeps" mode="overlay-meta">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   156
	<xsl:param name="item"/><xsl:param name="ns"/><xsl:param name="id"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   157
	<xsl:if test="$item[self::component]"> <!-- only valid for components for now-->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   158
		<xsl:variable name="matches" select="//Executable[@component=$id or substring-after(@component,':')=$id]"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   159
		<xsl:if test="$matches">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   160
			<meta rel="Dependencies" type="depmodel">	 <!-- there might be none, but tools should be able to live with an empty meta -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   161
				<xsl:for-each select="$matches"> <!-- potential match of IDs -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   162
					<xsl:variable name="myns"><xsl:apply-templates select="@component" mode="my-namespace"/></xsl:variable>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   163
					<xsl:if test="$myns = $ns"> <!-- actual match -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   164
						<Bin><xsl:copy-of select="@*[name()!='component']|*"/></Bin>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   165
					</xsl:if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   166
				</xsl:for-each>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   167
			</meta>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   168
		</xsl:if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   169
	</xsl:if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   170
	<xsl:variable name="matches" select="
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   171
		Layers[$item[self::layer]]/Layer[@name=$item/@name] |
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   172
		Blocks[$item[self::package]]/Block[@name=$item/@name] |
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   173
		SubBlocks[$item[self::package]]/SubBlock[@name=$item/@name] | 
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   174
		Collections[$item[self::collection]]/Collection[@name=$item/@name] |
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   175
		Components[$item[self::component]]/Component[@name=$item/@name]"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   176
	<xsl:if test="$matches">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   177
		<meta rel="Dependencies" type="generic">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   178
			<xsl:for-each select="$matches/dep">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   179
				<xsl:variable name="dep" select="."/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   180
				<xsl:for-each select="$item">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   181
					<xsl:for-each select="key('named',$dep/@name)[1]">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   182
						<dep ref="{@id}">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   183
							<xsl:copy-of select="$dep/@type"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   184
						</dep>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   185
					</xsl:for-each>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   186
				</xsl:for-each>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   187
			</xsl:for-each>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   188
		</meta>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   189
	</xsl:if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   190
</xsl:template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   191
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   192
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   193
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   194
<xsl:template match="/display-names" mode="overlay-attributes">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   195
	<xsl:param name="item"/><xsl:param name="ns"/><xsl:param name="id"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   196
	<xsl:variable name="match"> <!-- get the values of the refs that match $item --> 
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   197
		<xsl:for-each select="abbrev[@ref and (@ref=$id or substring-after(@ref,':')=$id)]"> <!-- potential match of IDs -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   198
			<xsl:variable name="myns"><xsl:apply-templates select="@ref" mode="my-namespace"/></xsl:variable>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   199
			<xsl:if test="$myns = $ns"> <!-- match -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   200
				<xsl:value-of select="concat(@ref,' ')"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   201
			</xsl:if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   202
		</xsl:for-each>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   203
	</xsl:variable>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   204
	
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   205
	<xsl:choose>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   206
		<xsl:when test="$match!=''">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   207
			<xsl:for-each select="abbrev[@ref=substring-before($match,' ')]"> <!-- match the first in the doc -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   208
				<xsl:copy-of select="@abbrev|@font|../@font"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   209
			</xsl:for-each>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   210
		</xsl:when>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   211
		<xsl:otherwise>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   212
			<xsl:for-each select="key('named',$item/@name)[1]"> <!-- match the first in the doc -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   213
				<xsl:copy-of select="@abbrev|@font|../@font"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   214
			</xsl:for-each>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   215
		</xsl:otherwise>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   216
	</xsl:choose>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   217
</xsl:template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   218
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   219
  
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   220
 
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   221
<!-- unsupported proprietary format. Uses name and tag name  to match
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   222
It's only real use is no longer needed now, but do we need to handle all the old files?
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   223
-->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   224
<xsl:template match="/attributes" mode="overlay-attributes"><xsl:param name="item"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   225
	<xsl:copy-of select="key('named',$item/ancestor::layer/@name)[self::layer and @inherit='yes']/attrs/@*"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   226
	<xsl:copy-of select="key('named',$item/ancestor::package/@name)[self::block or self::package and @inherit='yes']/attrs/@*"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   227
	<xsl:copy-of select="key('named',$item/ancestor::collection/@name)[self::coll and @inherit='yes']/attrs/@*"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   228
	<xsl:copy-of select="key('named',$item/@name)[starts-with(local-name($item),local-name()) and (not(@location) or (@location=$item/../@name))]/attrs/@*"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   229
</xsl:template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   230
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   231
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   232
<!-- consider supporting a techstream-like org document where it copies all data under the item and all data above it -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   233
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   234
  <!-- no symsym support, but consider some kind of SQL lookup-->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   235
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   236
<!-- special code for delaing with links follows -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   237
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   238
<xsl:template match="*" mode="link" priority="1"><xsl:param name="data"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   239
	<xsl:apply-templates select="$data" mode="link">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   240
		<xsl:with-param name="item" select="current()"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   241
	</xsl:apply-templates>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   242
</xsl:template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   243
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   244
<xsl:template match="sysdef" mode="link" priority="1"><xsl:param name="item"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   245
	<xsl:variable name="newhref">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   246
		<xsl:if test="$item/@id">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   247
			<!-- follwing vars to save trouble of recalulating each time -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   248
			<xsl:variable name="id"><xsl:apply-templates select="$item/@id" mode="my-id"/></xsl:variable>			<!-- namespaceless ID of this here -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   249
			<xsl:variable name="ns"><xsl:apply-templates select="$item/@id" mode="my-namespace"/></xsl:variable>	<!-- ID's namespace -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   250
			<xsl:for-each select="document(info/@href,.)/info/item[@href and (@ref=$id or substring-after(@ref,':')=$id)]">
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   251
				<xsl:variable name="myns"><xsl:apply-templates select="@ref" mode="my-namespace"/></xsl:variable>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   252
				<xsl:if test="$myns = $ns"> <!-- match -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   253
					<xsl:value-of select="concat(@href,'&#xa;')"/>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   254
				</xsl:if> 
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   255
			</xsl:for-each>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   256
		</xsl:if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   257
	</xsl:variable>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   258
	
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   259
	<xsl:value-of select="substring-before($newhref,'&#xa;')"/> <!-- use first defined -->
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   260
	<xsl:if test="$newhref='' "><xsl:value-of select="$item/@href"/></xsl:if>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   261
</xsl:template>
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   262
5acf50bbb618 Preview version of system model generator which supports 3.0 syntax
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
   263
</xsl:stylesheet>