common/sysdefdowngrade/sysdefdowngrade.xsl
author andy simpson <andrews@symbian.org>
Wed, 20 Jan 2010 15:03:03 +0000
changeset 852 41f42b520ea7
parent 319 257557b39754
child 853 bde28f2b1d99
permissions -rw-r--r--
add xsl for merging / downgrading system model
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
319
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     1
<?xml version="1.0" encoding="UTF-8"?>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     2
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     3
	<xsl:output method="xml" indent="yes"/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     4
	
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     5
	<xsl:param name="Path">os/deviceplatformrelease/foundation_system/system_model</xsl:param>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     6
	<!-- $Path is the location of the root system definition XML file. Must not end in /
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     7
		This is used to compute the absolute paths the 2.0 syntax needs-->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     8
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     9
<xsl:template match="/*">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    10
	<xsl:message terminate="yes">Cannot process this document</xsl:message>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    11
</xsl:template>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    12
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    13
<!-- can only handle 3.0.0 to 2.0.1 transforms
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    14
	Assumes only packages are using href
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    15
 -->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    16
<xsl:template match="/SystemDefinition[@schema='3.0.0']"> 
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    17
	<!-- process root system definition or package definition-->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    18
	<xsl:call-template name="DTD"/> <!-- insert 2.0.01 DTD -->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    19
  <SystemDefinition name="{*/@name}" schema="2.0.1">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    20
  	<xsl:apply-templates select="*|comment()"/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    21
  </SystemDefinition>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    22
</xsl:template>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    23
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    24
<xsl:template match="/SystemDefinition[@schema='3.0.0' and systemModel]"> 
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    25
	<xsl:call-template name="DTD"/> <!-- insert 2.0.01 DTD -->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    26
  <SystemDefinition name="{systemModel/@name}" schema="2.0.1">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    27
  	<xsl:apply-templates select="*|comment()"/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    28
  </SystemDefinition>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    29
</xsl:template>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    30
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    31
<xsl:template match="/SystemDefinition/package[@href]" priority="2">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    32
	<xsl:message terminate="yes">Package definition cannot link another package</xsl:message>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    33
</xsl:template>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    34
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    35
<xsl:template match="/SystemDefinition/package" priority="1">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    36
	<!-- process package definition file--> 
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    37
  <systemModel>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    38
  	<layer name="anonymous"> <!-- fake layer -->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    39
		<block>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    40
			<xsl:apply-templates mode="copy" select="@id|@name|@span|@level|@levels"/><!--  valid attribuites for 2.0 -->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    41
		  	<xsl:apply-templates select="*|comment()">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    42
		  		<xsl:with-param name="path" select="concat($Path,'/')"/> <!-- need to keep tack of where the current document is -->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    43
		  	</xsl:apply-templates>			
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    44
		</block>  
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    45
   	</layer>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    46
  </systemModel>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    47
</xsl:template>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    48
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    49
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    50
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    51
<xsl:template match="/"><xsl:apply-templates select="*"/></xsl:template>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    52
<xsl:template match="@*|comment()"><xsl:copy-of select="."/></xsl:template> 
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    53
	<!-- comments are copied verbatim. Attribtues are copied by default -->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    54
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    55
<xsl:template match="systemModel">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    56
	<xsl:copy>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    57
  	<xsl:apply-templates select="*|comment()"> <!-- no attributes -->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    58
  		<xsl:with-param name="path" select="$Path"/> <!-- need to keep tack of where the current document is -->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    59
  	</xsl:apply-templates>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    60
	</xsl:copy>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    61
</xsl:template>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    62
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    63
<xsl:template mode="copy" match="@*">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    64
	<xsl:copy-of select="."/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    65
</xsl:template>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    66
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    67
<xsl:template mode="copy" match="@id"> <!-- id in 3.0 is name in 2.0 -->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    68
	<xsl:attribute name="name"><xsl:value-of select="."/></xsl:attribute>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    69
</xsl:template>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    70
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    71
<xsl:template mode="copy" match="@name">  <!-- name in 3.0 is long-name in 2.0.1 -->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    72
	<xsl:if test=".!=../@id"> <!-- don't bother if it will be the same as name -->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    73
		<xsl:attribute name="long-name"><xsl:value-of select="."/></xsl:attribute>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    74
	</xsl:if>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    75
</xsl:template>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    76
	
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    77
<xsl:template match="layer"><xsl:param name="path"/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    78
	<layer>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    79
		<xsl:apply-templates mode="copy" select="@id|@name|@span|@levels"/> <!--  valid attribuites for 2.0 -->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    80
		<xsl:apply-templates select="*|comment()"> 
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    81
			<xsl:with-param name="path" select="$path"/> 
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    82
		</xsl:apply-templates>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    83
	</layer>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    84
</xsl:template>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    85
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    86
<xsl:template match="layer/package"><!-- translates to block -->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    87
	<xsl:param name="path"/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    88
	<block>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    89
		<xsl:apply-templates mode="copy" select="@id|@name|@span|@level|@levels"/><!--  valid attribuites for 2.0 -->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    90
		<xsl:choose>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    91
			<xsl:when test="@href">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    92
				<xsl:variable name="this" select="."/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    93
				<xsl:for-each select="document(@href,.)/SystemDefinition/*">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    94
					<xsl:if test="@id!=$this/@id">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    95
						<xsl:message terminate="yes">Error: IDs do not match: <xsl:value-of select="@id"/> vs <xsl:value-of select="$this/@id"/></xsl:message>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    96
					</xsl:if>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    97
					<xsl:if test="@name and @name!=@id and not($this/@name and $this/@name=$this/@id)">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    98
						<!-- set long-name only if name is different from the id and not set in child doc -->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    99
						<xsl:attribute name="long-name"><xsl:value-of select="@name"/></xsl:attribute>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   100
					</xsl:if>						
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   101
					<xsl:for-each select="@span|@levels|@level">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   102
						<!-- copy only if not set in child doc -->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   103
						<xsl:if test="not(this/@*[name()=name(current())])">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   104
							<xsl:copy-of select="."/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   105
						</xsl:if>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   106
					</xsl:for-each>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   107
					<xsl:apply-templates select="*|comment()">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   108
	  					<xsl:with-param name="path">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   109
	  						<xsl:call-template name="normpath">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   110
	  							<xsl:with-param name="path" select="concat($path,'/',$this/@href)"/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   111
	  						</xsl:call-template>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   112
	  					</xsl:with-param> 
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   113
	  				</xsl:apply-templates>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   114
				</xsl:for-each>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   115
			</xsl:when>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   116
			<xsl:otherwise>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   117
				<xsl:apply-templates select="*|comment()">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   118
  					<xsl:with-param name="path" select="$path"/> 
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   119
  				</xsl:apply-templates>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   120
			</xsl:otherwise>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   121
		</xsl:choose>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   122
	</block>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   123
</xsl:template>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   124
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   125
<xsl:template match="package/package">	<!-- translates to subblock --><xsl:param name="path"/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   126
	<subblock>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   127
		<xsl:apply-templates mode="copy" select="@id|@name"/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   128
		<xsl:apply-templates select="*|comment()">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   129
			<xsl:with-param name="path" select="$path"/> 
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   130
		</xsl:apply-templates>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   131
	</subblock>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   132
</xsl:template>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   133
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   134
<xsl:template match="package/package/pacakge"> <!-- cannot nest this deep --><xsl:param name="path"/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   135
	<xsl:message>Excessive nesting of packages: Ignoring <xsl:value-of select="@id"/></xsl:message>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   136
	<xsl:apply-templates select="*|comment()">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   137
		<xsl:with-param name="path" select="$path"/> 
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   138
	</xsl:apply-templates>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   139
</xsl:template>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   140
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   141
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   142
<xsl:template match="collection"><xsl:param name="path"/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   143
	<collection>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   144
		<xsl:apply-templates mode="copy" select="@id|@name|@level"/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   145
		<xsl:apply-templates select="*|comment()">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   146
			<xsl:with-param name="path" select="$path"/> 
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   147
		</xsl:apply-templates>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   148
	</collection>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   149
</xsl:template>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   150
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   151
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   152
<xsl:template match="component"><xsl:param name="path"/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   153
	<component>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   154
		<xsl:apply-templates mode="copy" select="@id|@name|@deprecated|@introduced|@filter|@purpose"/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   155
		<xsl:if test="contains(concat(' ',@class,' '),' plugin ')">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   156
			<xsl:attribute name="plugin">Y</xsl:attribute>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   157
		</xsl:if>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   158
		<xsl:call-template name="class">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   159
			<xsl:with-param name="remove">plugin</xsl:with-param>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   160
			<xsl:with-param name="add">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   161
				<xsl:if test="not(*) and comment()">placeholder</xsl:if>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   162
				<xsl:if test="@target='desktop'"> PC</xsl:if>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   163
			</xsl:with-param>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   164
		</xsl:call-template>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   165
	  	<xsl:apply-templates select="*|comment()">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   166
			<xsl:with-param name="path" select="$path"/> 
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   167
		</xsl:apply-templates>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   168
	</component>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   169
</xsl:template>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   170
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   171
<xsl:template match="unit[@base and not(@mrp or @bldFile)]"/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   172
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   173
<xsl:template match="unit"><xsl:param name="path"/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   174
	<unit>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   175
		<xsl:apply-templates select="@mrp|@bldFile|@late">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   176
			<xsl:with-param name="path" select="$path"/> 
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   177
		</xsl:apply-templates>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   178
		<xsl:copy-of select="@filter|@root|@version|@prebuilt|@priority"/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   179
	</unit>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   180
</xsl:template>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   181
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   182
<xsl:template match="unit/@late"> <!-- 2.0 uses Y/N, 3.0 uses yes/no -->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   183
	<xsl:attribute name="{name()}">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   184
		<xsl:choose>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   185
			<xsl:when test=".='yes'">Y</xsl:when>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   186
			<xsl:when test=".='no'">N</xsl:when>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   187
		</xsl:choose>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   188
	</xsl:attribute>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   189
</xsl:template>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   190
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   191
<xsl:template match="@mrp|@bldFile"><xsl:param name="path"/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   192
	<xsl:attribute name="{name()}">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   193
	<xsl:choose>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   194
		<xsl:when test="starts-with(.,'/')"> <!-- keep absolute paths verbatim (barring the leading / ) -->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   195
			<xsl:value-of select="substring-after(substring(.,2),'/')"/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   196
		</xsl:when>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   197
		<xsl:otherwise>	
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   198
			<xsl:call-template name="normpath">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   199
  				<xsl:with-param name="path">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   200
  					<xsl:call-template name="before">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   201
						<xsl:with-param name="text" select="$path"/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   202
					</xsl:call-template>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   203
					<xsl:value-of select="."/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   204
  				</xsl:with-param>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   205
  			</xsl:call-template>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   206
		</xsl:otherwise>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   207
	</xsl:choose>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   208
	</xsl:attribute>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   209
</xsl:template>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   210
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   211
<xsl:template match="meta"/> <!-- strip all meta tags -->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   212
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   213
<xsl:template match="meta[info/@contract]"> <!-- except contract -->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   214
	<xsl:copy-of select="info/@contract"/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   215
</xsl:template>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   216
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   217
<xsl:template name="class"><xsl:param name="remove"/><xsl:param name="add"/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   218
<!--  returns the value of the class attribute with the space-separated list of names in $remove taken out and those in $add added on (does not check for duplicates) -->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   219
	<xsl:param name="class" select="normalize-space(@class)"/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   220
	<xsl:variable name="r">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   221
		<xsl:text> </xsl:text>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   222
		<xsl:choose>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   223
			<xsl:when test="contains($remove,' ')"><xsl:value-of select="substring-before($remove,' ')"/></xsl:when>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   224
			<xsl:otherwise><xsl:value-of select="$remove"/></xsl:otherwise>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   225
		</xsl:choose>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   226
		<xsl:text> </xsl:text>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   227
	</xsl:variable>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   228
	<xsl:variable name="c">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   229
		<xsl:choose>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   230
			<xsl:when test="contains(concat(' ',$class,' '),$r)">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   231
				<xsl:value-of select="substring-before(concat(' ',$class,' '),$r)"/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   232
				<xsl:text> </xsl:text>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   233
				<xsl:value-of select="substring-after(concat(' ',$class,' '),$r)"/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   234
			</xsl:when>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   235
			<xsl:otherwise><xsl:value-of select="$class"/></xsl:otherwise>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   236
		</xsl:choose>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   237
		<xsl:if test="normalize-space($add)!=''"><xsl:value-of select="concat(' ',normalize-space($add))"/></xsl:if>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   238
	</xsl:variable>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   239
	<xsl:choose>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   240
		<xsl:when test="contains($remove,' ')">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   241
			<xsl:call-template name="class">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   242
				<xsl:with-param name="remove" select="substring-after($remove,' ')"/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   243
				<xsl:with-param name="class" select="$c"/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   244
			</xsl:call-template>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   245
		</xsl:when>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   246
		<xsl:when test="normalize-space($c)!=''">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   247
			<xsl:attribute name="class">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   248
				<xsl:value-of select="normalize-space($c)"/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   249
			</xsl:attribute>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   250
		</xsl:when>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   251
	</xsl:choose>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   252
</xsl:template>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   253
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   254
<xsl:template name="normpath"><xsl:param name="path"/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   255
<!-- normalize out any ".." in the path in $path  -->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   256
<xsl:choose>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   257
	<xsl:when test="contains($path,'/../')">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   258
	<xsl:call-template name="normpath">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   259
		<xsl:with-param name="path">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   260
		<xsl:call-template name="before">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   261
			<xsl:with-param name="text" select="substring-before($path,'/../')"/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   262
		</xsl:call-template>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   263
		<xsl:value-of select="substring-after($path,'/../')"/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   264
		</xsl:with-param>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   265
		</xsl:call-template>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   266
	</xsl:when>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   267
	<xsl:otherwise><xsl:value-of select="$path"/></xsl:otherwise>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   268
</xsl:choose>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   269
</xsl:template>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   270
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   271
<!-- return all text before the last / -->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   272
<xsl:template name="before"><xsl:param name="text"/>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   273
<xsl:if test="contains($text,'/')">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   274
	<xsl:value-of select="substring-before($text,'/')"/>/<xsl:call-template name="before"><xsl:with-param name="text" select="substring-after($text,'/')"/></xsl:call-template>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   275
	</xsl:if>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   276
</xsl:template>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   277
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   278
<xsl:template name="DTD">
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   279
<xsl:text disable-output-escaping="yes"><![CDATA[<!DOCTYPE SystemDefinition [
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   280
<!ELEMENT SystemDefinition ( systemModel )>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   281
<!ATTLIST SystemDefinition
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   282
  name CDATA #REQUIRED
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   283
  schema CDATA #REQUIRED
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   284
>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   285
<!-- all paths are relative to the environment variable specified by the root attribute, or SOURCEROOT if not.  -->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   286
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   287
<!-- System Model Section of DTD -->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   288
<!ELEMENT systemModel (layer+)>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   289
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   290
<!ELEMENT layer (block* | collection*)*>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   291
<!-- Kernel Services, Base Services, OS Services, Etc -->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   292
<!ATTLIST layer
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   293
  name CDATA #REQUIRED
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   294
  long-name CDATA #IMPLIED
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   295
  levels NMTOKENS #IMPLIED
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   296
  span CDATA #IMPLIED
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   297
>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   298
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   299
<!ELEMENT block (subblock* | collection*)*>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   300
 <!-- Generic OS services, Comms Services, etc -->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   301
<!ATTLIST block
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   302
  levels NMTOKENS #IMPLIED
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   303
  span CDATA #IMPLIED
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   304
  level NMTOKEN #IMPLIED
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   305
  name CDATA #REQUIRED
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   306
  long-name CDATA #IMPLIED
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   307
>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   308
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   309
<!ELEMENT subblock (collection)*>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   310
<!-- Cellular Baseband Services, Networking Services, etc -->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   311
<!ATTLIST subblock
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   312
  name CDATA #REQUIRED
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   313
  long-name CDATA #IMPLIED
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   314
>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   315
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   316
<!ELEMENT collection (component)*>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   317
<!-- Screen Driver, Content Handling, etc -->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   318
<!ATTLIST collection
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   319
  name CDATA #REQUIRED
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   320
  long-name CDATA #IMPLIED
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   321
  level NMTOKEN #IMPLIED
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   322
>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   323
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   324
<!ELEMENT component (unit)*>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   325
<!-- contains units or is a  package or prebuilt -->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   326
<!ATTLIST component
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   327
  name CDATA #REQUIRED
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   328
  long-name CDATA #IMPLIED
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   329
  deprecated CDATA #IMPLIED
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   330
  introduced CDATA #IMPLIED
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   331
  contract CDATA #IMPLIED
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   332
  plugin (Y|N) "N"
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   333
  filter CDATA #IMPLIED
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   334
  class NMTOKENS #IMPLIED
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   335
  supports CDATA #IMPLIED
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   336
  purpose ( optional | mandatory | development ) "optional"
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   337
>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   338
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   339
<!ELEMENT unit EMPTY >
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   340
<!-- must be buildable (bld.inf) -->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   341
<!-- bldFile  may someday be removed in favour of mrp -->
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   342
<!ATTLIST unit
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   343
  mrp CDATA #IMPLIED
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   344
  filter CDATA #IMPLIED
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   345
  bldFile CDATA #IMPLIED
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   346
  root CDATA #IMPLIED
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   347
  version NMTOKEN #IMPLIED
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   348
  prebuilt NMTOKEN #IMPLIED
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   349
  late (Y|N) #IMPLIED
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   350
  priority CDATA #IMPLIED
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   351
>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   352
]>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   353
]]></xsl:text>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   354
</xsl:template>
257557b39754 Added transformation of model file from version 3.0.0 to a version usable by Raptor
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   355
</xsl:stylesheet>