sysdeftools/sysdefdowngrade.xsl
branchHighFidelityModel
changeset 319 b085ba15cdaa
parent 162 3820d463ff00
equal deleted inserted replaced
316:079a06b9ec58 319:b085ba15cdaa
    17 	
    17 	
    18 	<xsl:param name="Path">os/deviceplatformrelease/foundation_system/system_model</xsl:param>
    18 	<xsl:param name="Path">os/deviceplatformrelease/foundation_system/system_model</xsl:param>
    19 	<!-- $Path is the location of the root system definition XML file. Must not end in /
    19 	<!-- $Path is the location of the root system definition XML file. Must not end in /
    20 		This is used to compute the absolute paths the 2.0 syntax needs-->
    20 		This is used to compute the absolute paths the 2.0 syntax needs-->
    21 	<xsl:param name="Root"/> <!-- space separated list of root variables in the form "VAR1=value1 VAR=value2" --> 
    21 	<xsl:param name="Root"/> <!-- space separated list of root variables in the form "VAR1=value1 VAR=value2" --> 
       
    22 	<xsl:param name="Strict" select="0"/> <!-- Strict processing on means namespaced extensions are stripped out --> 
    22 	<xsl:variable name="root" select="concat(' ',$Root,' ')"/> <!-- sort of hack to allow absolute paths in downgraded output -->
    23 	<xsl:variable name="root" select="concat(' ',$Root,' ')"/> <!-- sort of hack to allow absolute paths in downgraded output -->
    23 	<xsl:variable name="srcroot" select="substring-before(substring-after($root,' SRCROOT='),' ')"/> <!-- the default path prefix -->
    24 	<xsl:variable name="srcroot" select="substring-before(substring-after($root,' SRCROOT='),' ')"/> <!-- the default path prefix -->
    24 
    25 
    25 <xsl:template match="/*">
    26 <xsl:template match="/*">
    26 	<xsl:message terminate="yes">ERROR: Cannot process this document</xsl:message>
    27 	<xsl:message terminate="yes">ERROR: Cannot process this document</xsl:message>
    27 </xsl:template>
    28 </xsl:template>
    28 
    29 
    29 <!-- can only handle 3.0.0 to 2.0.1 transforms
    30 <!-- can only handle 3.0.x to 2.0.1 transforms
    30 	Assumes only packages are using href
    31 	Assumes only packages are using href
    31  -->
    32  -->
    32 <xsl:template match="/SystemDefinition[@schema='3.0.0']"> 
    33 <xsl:template match="/SystemDefinition[starts-with(@schema,'3.0.')]"> 
    33 	<!-- process root system definition or package definition-->
    34 	<!-- process root system definition or package definition-->
    34 	<xsl:call-template name="DTD"/> <!-- insert 2.0.01 DTD -->
    35 	<xsl:call-template name="DTD"/> <!-- insert 2.0.01 DTD -->
    35   <SystemDefinition name="{*/@name}" schema="2.0.1">
    36   <SystemDefinition name="{*/@name}" schema="2.0.1">
    36   	<xsl:apply-templates select="*|comment()"/>
    37   	<xsl:apply-templates select="*|comment()"/>
    37   </SystemDefinition>
    38   </SystemDefinition>
    38 </xsl:template>
    39 </xsl:template>
    39 
    40 
    40 <xsl:template match="/SystemDefinition[@schema='3.0.0' and systemModel]"> 
    41 <xsl:template match="/SystemDefinition[starts-with(@schema,'3.0.') and systemModel]"> 
    41 	<xsl:call-template name="DTD"/> <!-- insert 2.0.01 DTD -->
    42 	<xsl:call-template name="DTD"/> <!-- insert 2.0.01 DTD -->
    42   <SystemDefinition name="{systemModel/@name}" schema="2.0.1">
    43   <SystemDefinition name="{systemModel/@name}" schema="2.0.1">
    43   	<xsl:apply-templates select="*|comment()"/>
    44   	<xsl:apply-templates select="*|comment()"/>
    44   </SystemDefinition>
    45   </SystemDefinition>
    45 </xsl:template>
    46 </xsl:template>
   215 	<unit>
   216 	<unit>
   216 		<xsl:apply-templates select="@mrp|@bldFile|@late">
   217 		<xsl:apply-templates select="@mrp|@bldFile|@late">
   217 			<xsl:with-param name="path" select="$path"/> 
   218 			<xsl:with-param name="path" select="$path"/> 
   218 		</xsl:apply-templates>
   219 		</xsl:apply-templates>
   219 		<xsl:copy-of select="@filter|@root[not(contains($root,concat(' ',.,'=')))]|@version|@prebuilt|@priority"/>
   220 		<xsl:copy-of select="@filter|@root[not(contains($root,concat(' ',.,'=')))]|@version|@prebuilt|@priority"/>
   220 		<xsl:for-each select="@*[name()='qt:proFile' or name()='qt:qmakeArgs']">
   221 		<xsl:for-each select="@*[contains(name(),':') and not($Strict)]">
   221 			<xsl:attribute name="{local-name()}">
   222 			<xsl:attribute name="{local-name()}">
   222 				<xsl:value-of select="."/>
   223 				<xsl:value-of select="."/>
   223 			</xsl:attribute>
   224 			</xsl:attribute>
   224 		</xsl:for-each>
   225 		</xsl:for-each>
   225 	</unit>
   226 	</unit>