/ .. / / -> download
<?xml version="1.0" encoding="UTF-8"?>
<!--*********************************************************************************************************
**		S1000D Issue 4.0 BREX Stylesheet
**
**		Displays DMC, DM Title, path, use, and values (if any) in an easy-to-read format.
**		Enable display of embedded comments after the "Results" table by following instructions
**		on Line 282 below.
**
**		NOTE: Entries prefixed with "No validation possible" were determined by an XSL script
**					used for testing this BREX. Other tools may be able to validate such rules.
**
**		Use: <?xml-stylesheet type="text/xsl" href="brex4-0.xsl"?>
**
**		BTAS, FEB-SEP 2009
*************************************************************************************************************-->
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="/">
		<html>
			<head>
				<title><xsl:value-of select="//dmAddressItems/dmTitle/techName"/></title>
			</head>
			<body style="font-family:arial;font-size:x-small">
				<h5 style="text-align:center">DMC-<xsl:for-each select="//dmIdent/dmCode">
						<xsl:value-of select="concat(@modelIdentCode, '-', @systemDiffCode, '-', @systemCode, '-', @subSystemCode, @subSubSystemCode, '-', @assyCode, '-', @disassyCode, @disassyCodeVariant, '-', @infoCode, @infoCodeVariant, '-', @itemLocationCode)"/>
					</xsl:for-each>
				</h5>
				<h6 style="text-align:center">Issue 4.0 BREX</h6>
				<h6 style="text-align:center">
					<xsl:value-of select="//dmAddressItems/dmTitle/techName"/> - <xsl:value-of select="//dmAddressItems/dmTitle/infoName"/>
				</h6>
				<hr size="2"/>
				<table border="0" frame="void" style="width:100%;font-size:smaller;vertical-align:top;text-wrap:unrestricted;word-wrap:break-word;border:gray;">
					<tbody>
						<tr>
							<td style="color:blue;font-weight:bold;border-top:dashed thin gray;border-left:dashed thin gray;">Total rules</td>
							<td style="color:blue;font-weight:bold;text-align:right;border-top:dashed thin gray;border-right:dashed thin gray;"><xsl:value-of select="count(//structureObjectRule[not(@changeType='delete')])"/></td>
							<td> </td>
							<td style="color:black;border-left:dashed thin gray;border-top:dashed thin gray;">Issue # / In-Work #:</td>
							<td style="color:blue;border-right:dashed thin gray;border-top:dashed thin gray;"><xsl:value-of select="//dmIdent/issueInfo/@issueNumber"/> / <xsl:value-of select="//dmIdent/issueInfo/@inWork"/></td>
							<td> </td>
							<td style="color:black;width:20%;vertical-align:top;border-top:dashed thin gray;border-left:dashed thin gray;" rowspan="2">Responsible Partner Company (Enterprise Code):</td>
							<td style="color:blue;width:15%;vertical-align:top;border-top:dashed thin gray;border-right:dashed thin gray;" rowspan="2"><xsl:value-of select="//dmStatus/responsiblePartnerCompany/enterpriseName"/> (<xsl:value-of select="//dmStatus/responsiblePartnerCompany/@enterpriseCode"/>)</td>
						</tr>
						<tr>
							<td style="color:gray;border-left:dashed thin gray;">  Total @allowedValueFlag</td>
							<td style="color:blue;text-align:right;border-right:dashed thin gray;"><xsl:value-of select="count(//@allowedObjectFlag[not(ancestor::structureObjectRule[attribute::changeType='delete'])])"/></td>
							<td> </td>
							<td style="color:black;border-left:dashed thin gray;">Language / Country:</td>
							<td style="color:blue;border-right:dashed thin gray;"><xsl:value-of select="//dmIdent/language/@languageIsoCode"/> / <xsl:value-of select="//dmIdent/language/@countryIsoCode"/></td>
							<td> </td>
						</tr>
						<tr>
							<td style="color:gray;border-left:dashed thin gray;">  Total rules w/minimum of 1 value</td>
							<td style="color:blue;text-align:right;border-bottom:solid thin black;border-right:dashed thin gray;"><xsl:value-of select="count(//structureObjectRule/objectValue[1][not(ancestor::structureObjectRule[attribute::changeType='delete'])])"/></td>
							<td> </td>
							<td style="color:black;border-left:dashed thin gray;">Issue Date <span style="font-size:smaller;color:gray;">(YYYY-MM-DD)</span><span style="color:black;">:</span></td>
							<td style="color:blue;border-right:dashed thin gray;"><xsl:value-of select="//dmAddressItems/issueDate/@year"/>-<xsl:value-of select="//dmAddressItems/issueDate/@month"/>-<xsl:value-of select="//dmAddressItems/issueDate/@day"/></td>
							<td> </td>
							<td style="color:black;vertical-align:top;border-left:dashed thin gray;border-bottom:dashed thin gray;" rowspan="2">Originator (Enterprise Code):</td>
							<td style="color:blue;vertical-align:top;border-right:dashed thin gray;border-bottom:dashed thin gray;" rowspan="2"><xsl:value-of select="//dmStatus/originator/enterpriseName"/> (<xsl:value-of select="//dmStatus/originator/@enterpriseCode"/>)</td>
						</tr>
						<tr>
							<td style="color:green;font-weight:bold;border-left:dashed thin gray;border-bottom:dashed thin gray;">Possible validations</td>
							<td style="color:green;font-weight:bold;text-align:right;border-right:dashed thin gray;border-bottom:dashed thin gray;"><xsl:value-of select="count(//@allowedObjectFlag[not(ancestor::structureObjectRule[attribute::changeType='delete'])])+count(//structureObjectRule/objectValue[1][not(ancestor::structureObjectRule[attribute::changeType='delete'])])"/></td>
							<td> </td>
							<td style="color:black;border-left:dashed thin gray;border-bottom:dashed thin gray;">Issue Type: <span style="color:blue;"><xsl:value-of select="//dmStatus/@issueType"/><xsl:if test="not(//dmStatus/@issueType)">N/A</xsl:if></span></td>
							<td style="color:black;border-right:dashed thin gray;border-bottom:dashed thin gray;">Security: 
							<xsl:choose>
								<xsl:when test="//dmStatus/security/@securityClassification = 01"><span style="color:blue;">Unclassified</span></xsl:when>
								<xsl:when test="//dmStatus/security/@securityClassification = 03"><span style="color:blue;">Confidential</span></xsl:when>
								<xsl:when test="//dmStatus/security/@securityClassification = 04"><span style="color:blue;">Secret</span></xsl:when>
								<xsl:when test="//dmStatus/security/@securityClassification = 05"><span style="color:blue;">Top Secret</span></xsl:when>
								<xsl:otherwise><span style="color:red;">Prohibited Use!</span></xsl:otherwise>
							</xsl:choose>
							</td>
							<td> </td>
						</tr>
					</tbody>
				</table>
				
				<br/>

				<table border="0" frame="void" style="font-size:smaller;vertical-align:top;text-wrap:unrestricted;word-wrap:break-word;border:gray;">
					<tbody>
						<tr>
							<td style="padding: 10px;color:black;font-weight:bold;border-top:dashed thin gray;border-left:dashed thin gray;text-align:right;border-bottom:dashed thin gray;">BREX DM Reference:</td>
							<td style="padding: 10px;color:blue;vertical-align:top;border-top:dashed thin gray;text-align:center;border-bottom:dashed thin gray;">DMC-<xsl:for-each select="//brexDmRef/dmRef/dmRefIdent/dmCode">
							<xsl:value-of select="concat(@modelIdentCode, '-', @systemDiffCode, '-', @systemCode, '-', @subSystemCode, @subSubSystemCode, '-', @assyCode, '-', @disassyCode, @disassyCodeVariant, '-', @infoCode, @infoCodeVariant, '-', @itemLocationCode)"/></xsl:for-each></td>
							<td style="padding: 10px;color:gray;vertical-align:top;border-top:dashed thin gray;border-right:dashed thin gray;border-bottom:dashed thin gray;"><xsl:if test="not(//brexDmRef/dmRef/dmRefAddressItems/dmTitle)">(No title)</xsl:if>
<xsl:if test="//brexDmRef/dmRef/dmRefAddressItems/dmTitle">(<xsl:value-of select="//brexDmRef/dmRef/dmRefAddressItems/dmTitle/techName"/><xsl:if test="//brexDmRef/dmRef/dmRefAddressItems/dmTitle/infoName"> - <xsl:value-of select="//brexDmRef/dmRef/dmRefAddressItems/dmTitle/infoName"/></xsl:if>)</xsl:if></td>
						</tr>
						</tbody>
						</table>
						
				<xsl:if test="//content/refs">
				<table border="0" frame="void" style="font-size:smaller;vertical-align:top;text-wrap:unrestricted;word-wrap:break-word;border:gray;">
					<tbody>
						<tr>
							<td style="color:black;text-align:right;text-decoration:underline;">Additional References</td>
							<td style="color:black;vertical-align:top;"></td>
							<td style="color:black;vertical-align:top;"></td>
						</tr>
						<xsl:if test="//content/refs/dmRef">
						<tr>
							<td style="color:gray;"></td>
							<td style="color:black;vertical-align:top;text-align:right;">Data Module References -</td>
							<td style="color:black;vertical-align:top;"><xsl:for-each select="//content/refs/dmRef/dmRefIdent/dmCode">
						<xsl:number value="position()" format="1"/>. <span style="color:blue;">DMC-<xsl:value-of select="concat(@modelIdentCode, '-', @systemDiffCode, '-', @systemCode, '-', @subSystemCode, @subSubSystemCode, '-', @assyCode, '-', @disassyCode, @disassyCodeVariant, '-', @infoCode, @infoCodeVariant, '-', @itemLocationCode)"/></span><br/>
					</xsl:for-each></td>
						</tr>
						</xsl:if>
						<xsl:if test="//content/refs/pmRef">
						<tr>
							<td style="color:gray;"></td>
							<td style="color:black;vertical-align:top;">Publication Module References -</td>
							<td style="color:black;vertical-align:top;"><xsl:for-each select="//content/refs/pmRef/pmRefIdent/pmCode">
						<xsl:number value="position()" format="1"/>. <span style="color:blue;">PMC-<xsl:value-of select="concat(@modelIdentCode, '-', @pmIssuer, '-', @pmNumber, '-', @pmVolume)"/></span><br/>
					</xsl:for-each></td>
						</tr>
						</xsl:if>
						<xsl:if test="//content/refs/externalPubRef">
						<tr>
							<td style="color:gray;font-weight:bold;"></td>
							<td style="color:black;text-align:right;vertical-align: top;">External References -</td>
							<td style="color:black;"><xsl:for-each select="//content/refs/externalPubRef/externalPubRefIdent/externalPubCode">
						<xsl:number value="position()" format="1"/>. <span style="color:blue;"><xsl:value-of select="@pubCodingScheme"/> <xsl:value-of select="."/></span><xsl:if test="not(//content/refs/externalPubRef/externalPubRefIdent/externalPubTitle)"> (No title)</xsl:if>
<xsl:if test="//content/refs/externalPubRef/externalPubRefIdent/externalPubTitle"> (<xsl:value-of select="//content/refs/externalPubRef/externalPubRefIdent/externalPubTitle"/>)</xsl:if><br/>
					</xsl:for-each></td>
						</tr>
						</xsl:if>
					</tbody>
				</table>
			</xsl:if>

				<hr size="2"/>
					
				<br/>
				<table border="1" frame="box" style="font-size:smaller;vertical-align:top;text-wrap:unrestricted;word-wrap:break-word;overflow: scroll;table-layout:fixed;width:100%">
					<thead>
						<tr style="color:black;font-size:bigger;background-color:lime">
							<th colspan="4">Structure Object Rules</th>
						</tr>
						<tr style="background-color:silver">
							<th style="width:5%;">#</th>
							<th style="width:35%;">Path</th>
							<th style="width:35%;">Use</th>
							<th style="width:25%;">Value</th>
						</tr>
					</thead>
					<tbody>
						<xsl:for-each select="//structureObjectRuleGroup/structureObjectRule">
						<xsl:choose>
							<xsl:when test="@changeType='delete'">
								<tr>
									<td style="padding-left: 5px;background-color:silver;"><xsl:number value="position()" format="1"/>.</td>
									<td style="background-color:silver;color:gray;font-weight:bold;font-size:smaller;text-align:center;letter-spacing:1px;" colspan="3">[DELETED]</td>
								</tr>
							</xsl:when>
							<xsl:otherwise>
							<tr style="vertical-align:top">
								<td style="padding-left: 5px;"><xsl:number value="position()" format="1"/>.
									<xsl:choose>
										<xsl:when test="@changeType='modify'">
										<span style="background-color:lime;font-weight:bold;font-size:smaller;letter-spacing:1px;">[CHANGED]</span>
										</xsl:when>
										<xsl:when test="@changeType='add'">
										<span style="background-color:aqua;font-weight:bold;font-size:smaller;letter-spacing:1px;">[NEW]</span>
										</xsl:when>
									</xsl:choose>
								</td>
								<td>
									<xsl:if test="./objectPath/@allowedObjectFlag=1">
										<span style="color:blue;font-weight:bold">Required use of:</span>
										<br/>
									</xsl:if>
									<xsl:if test="./objectPath/@allowedObjectFlag=0">
										<span style="color:red;font-weight:bold">Prohibited use of:</span>
										<br/>
									</xsl:if>
									<xsl:if test="not(./objectPath/@allowedObjectFlag) and not(./objectValue)">
										<span style="color:teal;font-weight:bold">No validation possible:</span>
										<br/>
									</xsl:if>
									<xsl:if test="./objectValue">
										<span style="color:purple;font-weight:bold">Values are restricted:</span>
										<br/>
									</xsl:if>
									<xsl:value-of select="./objectPath"/>
								</td>
								<td>
									<xsl:value-of select="objectUse"/>
								</td>
								<td>
									<xsl:apply-templates select="objectValue"/>
								</td>
							</tr>
							</xsl:otherwise>
						</xsl:choose>
						</xsl:for-each>
					</tbody>
				</table><p/>
				<hr size="2"/>
				
					<!-- ***************************************************************************************************************
					**		
					**		Display SNS
					**		Added: 04/10/09
					**		
					 *******************************************************************************************************************-->
				<xsl:if test="//snsRules">
					<p/>
					<table width="100%" border="1" frame="box" style="font-size:smaller;vertical-align:top;">
					<thead>
						<tr style="color:black;font-size:bigger;background-color:lime">
							<th colspan="4">SNS Rules</th>
						</tr>
						<tr style="background-color:silver">
							<th width="5%">#</th>
							<th width="10%">Code</th>
							<th width="15%">Description</th>
							<th width="70%">Title</th>
						</tr>
					</thead>
					<tbody>
					<xsl:for-each select="//snsDescr">
						<xsl:for-each select="//snsSystem">
								<tr style="vertical-align:top">
									<td style="padding-left: 5px;">
										<xsl:number value="position()" format="1"/>.</td>
									<td style="padding-left: 5px;">
										<xsl:value-of select="snsCode"/>
										
											<xsl:for-each select="./snsSubSystem">
												<br/><xsl:text>    </xsl:text><xsl:value-of select="snsCode"/>
													<xsl:for-each select="./snsSubSubSystem">
														<br/><xsl:text>      </xsl:text><xsl:value-of select="snsCode"/>
															<xsl:for-each select="./snsAssy">
																<br/><xsl:text>        </xsl:text><xsl:value-of select="snsCode"/>
															</xsl:for-each>
													</xsl:for-each>
											</xsl:for-each>
									</td>
									<td style="padding-left: 5px;">
										<span style="color:gray">System</span>
										
											<xsl:for-each select="./snsSubSystem">
												<br/><span style="color:gray">    SubSystem</span>
													<xsl:for-each select="./snsSubSubSystem">
														<br/><span style="color:gray">      SubSubSystem</span>
															<xsl:for-each select="./snsAssy">
																<br/><span style="color:gray">        Assembly</span>
															</xsl:for-each>
													</xsl:for-each>
											</xsl:for-each>
									</td>
									<td style="padding-left: 5px;">
										<xsl:value-of select="snsTitle"/>
											<xsl:for-each select="./snsSubSystem">
												<br/><xsl:text>    </xsl:text><xsl:value-of select="snsTitle"/>
													<xsl:for-each select="./snsSubSubSystem">
														<br/><xsl:text>      </xsl:text><xsl:value-of select="snsTitle"/>
															<xsl:for-each select="./snsAssy">
																<br/><xsl:text>        </xsl:text><xsl:value-of select="snsTitle"/>
															</xsl:for-each>
													</xsl:for-each>
											</xsl:for-each>
									</td>
								</tr>
						</xsl:for-each>
					</xsl:for-each>
					</tbody>
					</table><p/>
					<hr size="2"/>
				</xsl:if>
				
					<!-- ***************************************************************************************************************
					**		
					**		Display Notations
					**		Added: 04/10/09
					**		
					 *******************************************************************************************************************-->
				<xsl:if test="//notationRuleList">
					<p/>
					<table width="100%" border="1" frame="box" style="font-size:smaller;vertical-align:top;">
					<thead>
						<tr style="color:black;font-size:bigger;background-color:lime">
							<th colspan="3">Notation Rules</th>
						</tr>
						<tr style="background-color:silver">
							<th width="5%">#</th>
							<th width="15%">Notation Name</th>
							<th width="80%">Object Use</th>
						</tr>
					</thead>
					<tbody>
					<xsl:for-each select="//notationRule">
							<tr style="vertical-align:top">
								<td style="padding-left: 5px;">
									<xsl:number value="position()" format="1"/>.</td>
								<td style="padding-left: 5px;">
									<xsl:value-of select="notationName"/>
								</td>
								<td style="padding-left: 5px;">
									<xsl:value-of select="objectUse"/>
								</td>
							</tr>
					</xsl:for-each>
					</tbody>
					</table><p/>
					<hr size="2"/>
				</xsl:if>
				
				<!--*******************************************************************************************************************
				**		
				**		If comments need to be displayed, uncomment the line <xsl:apply-templates/> below.
				**		
				***********************************************************************************************************************
				<xsl:apply-templates/>-->
			</body>
		</html>
	</xsl:template>
	<xsl:template match="objectValue">
		<xsl:if test="//objectValue">
			<xsl:for-each select=".">
				<xsl:if test="./@valueForm">
					<xsl:choose>
						<xsl:when test="@valueForm='range'">
						<span style="font-weight:bold;color:green">Range: </span>
						</xsl:when>
						<xsl:when test="@valueForm='single'">
						<span style="font-weight:bold;color:blue">Single Value: </span>
						</xsl:when>
						<xsl:when test="@valueForm='pattern'">
						<span style="font-weight:bold;color:purple">Pattern: </span>
						</xsl:when>
					</xsl:choose>
				</xsl:if>
				<xsl:if test="./@valueAllowed">
					<xsl:value-of select="./@valueAllowed"/>
				</xsl:if>
				<xsl:if test=". != ''">
					<xsl:text>, </xsl:text>
					<xsl:value-of select="."/>
				</xsl:if>
			</xsl:for-each>
			<br/>
		</xsl:if>
	</xsl:template>
	<xsl:template match="comment()">
					<p style="color:gray;font-weight:bold;font-style:italic;font-size:bigger"><xsl:value-of select="."/></p>
	</xsl:template>
</xsl:stylesheet>


/ gopher://khzae.net/0/s1kd/links/projects/3031/brex4-0.xsl
Styles: Light Dark Classic