sysdeftools/validate/modelcheck.xsl
author Bob Rosenberg <bob.rosenberg@nokia.com>
Thu, 22 Jul 2010 12:30:22 +0100
branchHighFidelityModel
changeset 390 a47fc547d2e3
parent 334 18ee574c682a
permissions -rw-r--r--
Simplify and add hacks for some XSLT processors: simpler xpath expressions in filtering.xsl and qt hack in mergesysdef.xsl. Move path processing XSLT templates to separate module so it can be used in both joining and merging. Add .bat files for each of the PERL and XSLT scripts so they can be more esily called from the command line (joinsysdef.bat calls joinsysdef.pl, not joinsysdef.xsl).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
151
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     1
<xsl:stylesheet  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     2
<!--Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     3
	All rights reserved.
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     4
	This component and the accompanying materials are made available
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     5
	under the terms of the License "Eclipse Public License v1.0"
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     6
	which accompanies this distribution, and is available
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     7
	at the URL "http://www.eclipse.org/legal/epl-v10.html".
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     8
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
     9
	Initial Contributors:
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    10
	Nokia Corporation - initial contribution.
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    11
	Contributors:
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    12
	Description:
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    13
	Validate a system definition file or files and output results in HTML
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    14
-->
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    15
	<xsl:output method="html"/>
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    16
	<xsl:include href="test-model.xsl"/>
334
18ee574c682a More verbose error messages and validation in sysdeftools
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 151
diff changeset
    17
	<xsl:param name="path-errors" select="/model/@path-errors='yes' "/>
18ee574c682a More verbose error messages and validation in sysdeftools
Bob Rosenberg <bob.rosenberg@nokia.com>
parents: 151
diff changeset
    18
151
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    19
<xsl:template match="/model">
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    20
	<html><head>
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    21
		<title>Cross-Checking System Model</title>
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    22
		<style>p {margin: 0px; padding: 0px} 
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    23
			p.warn span {color: blue}
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    24
			p.note span {color: green}
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    25
			p.err span {font-weight: bold}
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    26
			p.err {color: red; background: yellow}
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    27
			p.note {font-size: 90%}
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    28
			<xsl:if test="contains(concat(' ',normalize-space(/model/@supress-errors),' '),' note ')">
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    29
				p.note {display: none}
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    30
			</xsl:if>
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    31
			<xsl:if test="contains(concat(' ',normalize-space(/model/@supress-errors),' '),' err ')">
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    32
				p.err {display: none}
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    33
			</xsl:if>
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    34
			<xsl:if test="contains(concat(' ',normalize-space(/model/@supress-errors),' '),' warn ')">
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    35
				p.warn {display: none}
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    36
			</xsl:if>
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    37
		</style>
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    38
	</head><body>
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    39
	<xsl:apply-templates select="." mode="check"/>
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    40
	</body></html>
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    41
</xsl:template>
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    42
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    43
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    44
<xsl:template name="Section"><xsl:param name="text"/><xsl:param name="sub"/>
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    45
<h2><xsl:value-of select="$text"/>
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    46
<xsl:if test="$sub!=''"><xsl:text> </xsl:text> <small>(<xsl:value-of select="$sub"/>)</small></xsl:if></h2>
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    47
</xsl:template>
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    48
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    49
<xsl:template name="Note"><xsl:param name="text"/><xsl:param name="sub"/>
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    50
<p class="note">
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    51
	<span>Note:</span>
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    52
	<xsl:text> </xsl:text>
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    53
	<xsl:copy-of select="$text"/>
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    54
<xsl:if test="$sub!=''"><xsl:text> </xsl:text> <small>(<xsl:value-of select="$sub"/>)</small></xsl:if></p>
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    55
</xsl:template>
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    56
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    57
<xsl:template name="Warning"><xsl:param name="text"/><xsl:param name="sub"/>
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    58
<p class="warn">
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    59
	<span>Warning:</span>
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    60
	<xsl:text> </xsl:text>
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    61
	<xsl:value-of select="$text"/>
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    62
<xsl:if test="$sub!=''"><xsl:text> </xsl:text> <small>(<xsl:value-of select="$sub"/>)</small></xsl:if></p>
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    63
</xsl:template>
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    64
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    65
<xsl:template name="Error"><xsl:param name="text"/><xsl:param name="sub"/>
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    66
<p class="err">
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    67
	<span>Error:</span>
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    68
	<xsl:text> </xsl:text>
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    69
	<xsl:value-of select="$text"/>
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    70
<xsl:if test="$sub!=''"><xsl:text> </xsl:text> <small>(<xsl:value-of select="$sub"/>)</small></xsl:if></p>
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    71
</xsl:template>
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    72
84b123918d3f Added latest version of sysdeftools. See readme.txt for details on content.
Bob Rosenberg <bob.rosenberg@nokia.com>
parents:
diff changeset
    73
</xsl:stylesheet>