metatools/sysdeftools/lib/modelcheck.xsl
changeset 624 f70b728ea30c
equal deleted inserted replaced
621:96fee2635b19 624:f70b728ea30c
       
     1 <xsl:stylesheet  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
       
     2 <!--Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 	All rights reserved.
       
     4 	This component and the accompanying materials are made available
       
     5 	under the terms of the License "Eclipse Public License v1.0"
       
     6 	which accompanies this distribution, and is available
       
     7 	at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 
       
     9 	Initial Contributors:
       
    10 	Nokia Corporation - initial contribution.
       
    11 	Contributors:
       
    12 	Description:
       
    13 	Validate a system definition file or files and output results in HTML
       
    14 -->
       
    15 	<xsl:output method="html"/>
       
    16 	<xsl:include href="test-model.xsl"/>
       
    17 	<xsl:param name="path-errors" select="/model/@path-errors='yes' "/>
       
    18 	 <!--1 - (optional) If present, it will check to see if unit paths follow the coding standards-->
       
    19 
       
    20 <xsl:template match="/model">
       
    21 	<html><head>
       
    22 		<title>Cross-Checking System Model</title>
       
    23 		<style>p {margin: 0px; padding: 0px} 
       
    24 			p.warn span {color: blue}
       
    25 			p.note span {color: green}
       
    26 			p.err span {font-weight: bold}
       
    27 			p.err {color: red; background: yellow}
       
    28 			p.note {font-size: 90%}
       
    29 			<xsl:if test="contains(concat(' ',normalize-space(/model/@supress-errors),' '),' note ')">
       
    30 				p.note {display: none}
       
    31 			</xsl:if>
       
    32 			<xsl:if test="contains(concat(' ',normalize-space(/model/@supress-errors),' '),' err ')">
       
    33 				p.err {display: none}
       
    34 			</xsl:if>
       
    35 			<xsl:if test="contains(concat(' ',normalize-space(/model/@supress-errors),' '),' warn ')">
       
    36 				p.warn {display: none}
       
    37 			</xsl:if>
       
    38 		</style>
       
    39 	</head><body>
       
    40 	<xsl:apply-templates select="." mode="check"/>
       
    41 	</body></html>
       
    42 </xsl:template>
       
    43 
       
    44 
       
    45 <xsl:template name="Section"><xsl:param name="text"/><xsl:param name="sub"/>
       
    46 <h2><xsl:value-of select="$text"/>
       
    47 <xsl:if test="$sub!=''"><xsl:text> </xsl:text> <small>(<xsl:value-of select="$sub"/>)</small></xsl:if></h2>
       
    48 </xsl:template>
       
    49 
       
    50 <xsl:template name="Note"><xsl:param name="text"/><xsl:param name="sub"/>
       
    51 <p class="note">
       
    52 	<span>Note:</span>
       
    53 	<xsl:text> </xsl:text>
       
    54 	<xsl:copy-of select="$text"/>
       
    55 <xsl:if test="$sub!=''"><xsl:text> </xsl:text> <small>(<xsl:value-of select="$sub"/>)</small></xsl:if></p>
       
    56 </xsl:template>
       
    57 
       
    58 <xsl:template name="Warning"><xsl:param name="text"/><xsl:param name="sub"/>
       
    59 <p class="warn">
       
    60 	<span>Warning:</span>
       
    61 	<xsl:text> </xsl:text>
       
    62 	<xsl:value-of select="$text"/>
       
    63 <xsl:if test="$sub!=''"><xsl:text> </xsl:text> <small>(<xsl:value-of select="$sub"/>)</small></xsl:if></p>
       
    64 </xsl:template>
       
    65 
       
    66 <xsl:template name="Error"><xsl:param name="text"/><xsl:param name="sub"/>
       
    67 <p class="err">
       
    68 	<span>Error:</span>
       
    69 	<xsl:text> </xsl:text>
       
    70 	<xsl:value-of select="$text"/>
       
    71 <xsl:if test="$sub!=''"><xsl:text> </xsl:text> <small>(<xsl:value-of select="$sub"/>)</small></xsl:if></p>
       
    72 </xsl:template>
       
    73 
       
    74 </xsl:stylesheet>