bldsystemtools/sysdeftools/validate/modelcheck.xsl
changeset 0 83f4b4db085c
child 2 99082257a271
equal deleted inserted replaced
-1:000000000000 0:83f4b4db085c
       
     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:template match="/model">
       
    18 	<html><head>
       
    19 		<title>Cross-Checking System Model</title>
       
    20 		<style>p {margin: 0px; padding: 0px} 
       
    21 			p.warn span {color: blue}
       
    22 			p.note span {color: green}
       
    23 			p.err span {font-weight: bold}
       
    24 			p.err {color: red; background: yellow}
       
    25 			p.note {font-size: 90%}
       
    26 			<xsl:if test="contains(concat(' ',normalize-space(/model/@supress-errors),' '),' note ')">
       
    27 				p.note {display: none}
       
    28 			</xsl:if>
       
    29 			<xsl:if test="contains(concat(' ',normalize-space(/model/@supress-errors),' '),' err ')">
       
    30 				p.err {display: none}
       
    31 			</xsl:if>
       
    32 			<xsl:if test="contains(concat(' ',normalize-space(/model/@supress-errors),' '),' warn ')">
       
    33 				p.warn {display: none}
       
    34 			</xsl:if>
       
    35 		</style>
       
    36 	</head><body>
       
    37 	<xsl:apply-templates select="." mode="check"/>
       
    38 	</body></html>
       
    39 </xsl:template>
       
    40 
       
    41 
       
    42 <xsl:template name="Section"><xsl:param name="text"/><xsl:param name="sub"/>
       
    43 <h2><xsl:value-of select="$text"/>
       
    44 <xsl:if test="$sub!=''"><xsl:text> </xsl:text> <small>(<xsl:value-of select="$sub"/>)</small></xsl:if></h2>
       
    45 </xsl:template>
       
    46 
       
    47 <xsl:template name="Note"><xsl:param name="text"/><xsl:param name="sub"/>
       
    48 <p class="note">
       
    49 	<span>Note:</span>
       
    50 	<xsl:text> </xsl:text>
       
    51 	<xsl:copy-of select="$text"/>
       
    52 <xsl:if test="$sub!=''"><xsl:text> </xsl:text> <small>(<xsl:value-of select="$sub"/>)</small></xsl:if></p>
       
    53 </xsl:template>
       
    54 
       
    55 <xsl:template name="Warning"><xsl:param name="text"/><xsl:param name="sub"/>
       
    56 <p class="warn">
       
    57 	<span>Warning:</span>
       
    58 	<xsl:text> </xsl:text>
       
    59 	<xsl:value-of select="$text"/>
       
    60 <xsl:if test="$sub!=''"><xsl:text> </xsl:text> <small>(<xsl:value-of select="$sub"/>)</small></xsl:if></p>
       
    61 </xsl:template>
       
    62 
       
    63 <xsl:template name="Error"><xsl:param name="text"/><xsl:param name="sub"/>
       
    64 <p class="err">
       
    65 	<span>Error:</span>
       
    66 	<xsl:text> </xsl:text>
       
    67 	<xsl:value-of select="$text"/>
       
    68 <xsl:if test="$sub!=''"><xsl:text> </xsl:text> <small>(<xsl:value-of select="$sub"/>)</small></xsl:if></p>
       
    69 </xsl:template>
       
    70 
       
    71 </xsl:stylesheet>