More verbose error messages and validation in sysdeftools HighFidelityModel
authorBob Rosenberg <bob.rosenberg@nokia.com>
Fri, 09 Jul 2010 14:26:21 +0100
branchHighFidelityModel
changeset 334 18ee574c682a
parent 331 75ee3fb17193
child 335 633f3bea9521
More verbose error messages and validation in sysdeftools
sysdeftools/joinsysdef-module.xsl
sysdeftools/mergesysdef-module.xsl
sysdeftools/validate/modelcheck.xsl
sysdeftools/validate/test-model.xsl
sysdeftools/validate/validate-sysdef.xsl
--- a/sysdeftools/joinsysdef-module.xsl	Wed Jun 30 16:05:11 2010 +0100
+++ b/sysdeftools/joinsysdef-module.xsl	Fri Jul 09 14:26:21 2010 +0100
@@ -54,7 +54,7 @@
 					<xsl:choose>
 						<xsl:when test="$n='id'"/> <!-- never copy this, always set -->
 						<xsl:when test="$origin/@*[name()=$n]"> <!-- don't copy if already set -->
-							<xsl:message>Note: Cannot set "<xsl:value-of select="$n"/>", already set. Ignoring linked value</xsl:message>
+							<xsl:message>Note: Cannot set "<xsl:value-of select="$n"/>", already set on <xsl:value-of select="$origin/@id"/>. Ignoring linked value</xsl:message>
 						</xsl:when>
 						<xsl:when test="$n='before' or $n='replace'">
 							<!-- ensure ns is correct (if any future attribtues will ever use an ID, process it here too)-->
--- a/sysdeftools/mergesysdef-module.xsl	Wed Jun 30 16:05:11 2010 +0100
+++ b/sysdeftools/mergesysdef-module.xsl	Fri Jul 09 14:26:21 2010 +0100
@@ -244,7 +244,7 @@
 			<xsl:attribute name="levels"><xsl:value-of select="normalize-space($lev)"/></xsl:attribute>
 		</xsl:when>
 		<xsl:otherwise> <!--  if they differ, use the origin's levels -->
-			<xsl:message>Note: levels differ "<xsl:value-of select="."/>" vs "<xsl:value-of select="$other/@levels"/>"</xsl:message>
+			<xsl:message>Note: levels differ "<xsl:value-of select="."/>" vs "<xsl:value-of select="$other/@levels"/>" on <xsl:value-of select="../@id"/></xsl:message>
 			<xsl:copy-of select="."/>
 		</xsl:otherwise>
 	</xsl:choose>
--- a/sysdeftools/validate/modelcheck.xsl	Wed Jun 30 16:05:11 2010 +0100
+++ b/sysdeftools/validate/modelcheck.xsl	Fri Jul 09 14:26:21 2010 +0100
@@ -14,6 +14,8 @@
 -->
 	<xsl:output method="html"/>
 	<xsl:include href="test-model.xsl"/>
+	<xsl:param name="path-errors" select="/model/@path-errors='yes' "/>
+
 <xsl:template match="/model">
 	<html><head>
 		<title>Cross-Checking System Model</title>
--- a/sysdeftools/validate/test-model.xsl	Wed Jun 30 16:05:11 2010 +0100
+++ b/sysdeftools/validate/test-model.xsl	Fri Jul 09 14:26:21 2010 +0100
@@ -13,7 +13,6 @@
 	Module containing the validation logic for system definition 3.0.0 syntax
 -->
 	<xsl:key name="named" match="*[ancestor::systemModel]" use="@name"/>
-	<xsl:param name="path-errors" select="0"/>
 	<xsl:param name="Filename"/>
 	<xsl:variable name="info" select="document(/model//info[@type='extra']/@href,/model)//c"/>
 
@@ -93,10 +92,27 @@
 
 <xsl:template match="@before|@id|package/@span|layer/@span|collection/@level|package/@level|package/@levels|layer/@levels" mode="valid"/> <!-- really should check syntax -->
 
-<xsl:template match="@name|@href|@filter" mode="valid"/> 
+<xsl:template match="@name|@href|@filter|unit/@version|unit/@prebuilt" mode="valid"/> 
 
 <xsl:template match="component/@introduced|component/@deprecated" mode="valid"/> 
 
+<xsl:template match="component/@origin-model" mode="valid"/>
+
+<xsl:template match="unit/@priority" mode="valid">
+	<xsl:call-template name="Note"><xsl:with-param name="text">Attribute <xsl:value-of select="name()"/> is deprecated</xsl:with-param></xsl:call-template>
+</xsl:template>
+
+
+<xsl:template match="@*[namespace-uri()!='']" mode="valid"> 
+	<xsl:call-template name="Note"><xsl:with-param name="text">Extension attribute <xsl:value-of select="local-name()"/>="<xsl:value-of select="."/>" in namespace <xsl:value-of select="namespace-uri()"/></xsl:with-param></xsl:call-template>
+</xsl:template>
+
+<xsl:template match="@*[namespace-uri()='http://www.nokia.com/qt' and local-name()='proFile']" mode="valid"/> 
+	
+
+<xsl:template match="@*[namespace-uri()='http://www.nokia.com/qt' and local-name()='qmakeArgs']" mode="valid"> 
+	<xsl:call-template name="Note"><xsl:with-param name="text">Should avoid using extension attribute <xsl:value-of select="local-name()"/>="<xsl:value-of select="."/>" in namespace <xsl:value-of select="namespace-uri()"/></xsl:with-param></xsl:call-template>
+</xsl:template>
 
 
 <xsl:template match="@replace" mode="valid">
@@ -283,12 +299,17 @@
 <xsl:template match="meta/@rel | meta/@type | meta/@href"/> <!-- anything is valid -->
 
 <xsl:template match="unit">	<xsl:param name="filename"/>
-	<xsl:apply-templates select="@mrp|@bldFile">
+	<xsl:apply-templates select="@*">
 		<xsl:with-param name="filename" select="$filename"/>
 	</xsl:apply-templates>
 </xsl:template>
 
 
+<xsl:template match="unit/@*" priority="-1">	
+	<xsl:apply-templates select="." mode="valid"/>
+</xsl:template>
+
+
 <xsl:template match="@id" mode="path">
 	<xsl:choose>
 		<xsl:when test="contains(.,':')"><xsl:value-of  select="substring-after(.,':')"/></xsl:when>
@@ -315,7 +336,7 @@
 		<xsl:otherwise><xsl:value-of select="@id"/></xsl:otherwise>
 	</xsl:choose>
 </xsl:template>
-<xsl:template match="@bldFile|@mrp"><xsl:param name="filename"/>
+<xsl:template match="@bldFile|@mrp|@base"><xsl:param name="filename"/>
 <xsl:if test="substring(.,string-length(.))='/'">
 		<xsl:call-template name="Warning"><xsl:with-param name="text"><code><xsl:value-of select="name()"/></code> path "<xsl:value-of select="."/>" should not end in /</xsl:with-param></xsl:call-template>
 </xsl:if>
--- a/sysdeftools/validate/validate-sysdef.xsl	Wed Jun 30 16:05:11 2010 +0100
+++ b/sysdeftools/validate/validate-sysdef.xsl	Fri Jul 09 14:26:21 2010 +0100
@@ -15,6 +15,7 @@
 	<xsl:output method="text"/>
 	<xsl:include href="test-model.xsl"/>
 	<xsl:param name="level" select="3"/>
+	<xsl:param name="path-errors" select="0"/>
 
 <xsl:template name="Section"><xsl:param name="text"/><xsl:param name="sub"/>
 <xsl:text>&#xa;&#xa;</xsl:text>