<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fm="http://www.itp-x.co.uk/xslt">
	
<!--
****************************************************************
* ADOBE SYSTEMS INCORPORATED                                   *
* Copyright 2006 © 2006 Adobe Systems Incorporated             *
* All Rights Reserved                                          *
*                                                              *
* NOTICE:  Adobe permits you to use, modify, and distribute    *
* this file in accordance with the terms of the Adobe license  *
* agreement accompanying it.  If you have received this file   *
* from a source other than Adobe, then your use, modification, *
* or distribution of it requires the prior written permission  *
* of Adobe.                                                    *
* _____________________________________________________________*
* Adobe FrameMaker 7.2 Application Pack for S1000D             *
*                                                              *
* BREX export transform                                        *
* Version   Date         By                                    *
* 0.2b      2006-08-21   Ian Proudfoot, iTP-X                  *
*                                                              *
****************************************************************
-->
	<xsl:param name="brexpath"/>

	<xsl:variable name="brexref"
	              select="concat($brexpath,'DMC-',       
				  //brexref//modelic,'-',       
				  //brexref//sdc,'-',       
				  //brexref//chapnum,'-',       
				  //brexref//section,       
				  //brexref//subsect,'-',       
				  //brexref//subject,'-',       
				  //brexref//discode,       
				  //brexref//discodev,'-',       
				  //brexref//incode,       
				  //brexref//incodev,'-',       
				  //brexref//itemloc,'_',       
				  //brexref//issno/@issno,'-00.xml')"/>

	<xsl:template name="brexmerge">

		<xsl:choose>
			<xsl:when test="not(document($brexref)//objval=current())">
				<xsl:value-of select="current()"/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="document($brexref)//objval[text() = current()]/@val1"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

	<xsl:template match="//@acrotype">
		<xsl:attribute name="acrotype">
			<xsl:call-template name="brexmerge"/>
		</xsl:attribute>
	</xsl:template>

	<xsl:template match="//@caveat" name="caveat">
		<xsl:attribute name="caveat">
			<xsl:call-template name="brexmerge"/>
		</xsl:attribute>
	</xsl:template>

	<xsl:template match="//security/@class" name="class">
		<xsl:attribute name="class">
			<xsl:call-template name="brexmerge"/>
		</xsl:attribute>
	</xsl:template>

	<xsl:template match="//@color">
		<xsl:attribute name="color">
			<xsl:call-template name="brexmerge"/>
		</xsl:attribute>
	</xsl:template>

	<xsl:template match="//@commcls" name="commcls">
		<xsl:attribute name="commcls">
			<xsl:call-template name="brexmerge"/>
		</xsl:attribute>
	</xsl:template>

	<xsl:template match="//@cprio">
		<xsl:attribute name="cprio">
			<xsl:call-template name="brexmerge"/>
		</xsl:attribute>
	</xsl:template>

	<xsl:template match="//@crewmem">
		<xsl:attribute name="crewmem">
			<xsl:call-template name="brexmerge"/>
		</xsl:attribute>
	</xsl:template>

	<xsl:template match="//@drilltyp">
		<xsl:attribute name="drilltyp">
			<xsl:call-template name="brexmerge"/>
		</xsl:attribute>
	</xsl:template>

	<xsl:template match="//@emph">
		<xsl:attribute name="emph">
			<xsl:call-template name="brexmerge"/>
		</xsl:attribute>
	</xsl:template>

	<xsl:template match="//@prefix">
		<xsl:attribute name="prefix">
			<xsl:call-template name="brexmerge"/>
		</xsl:attribute>
	</xsl:template>

	<xsl:template match="//@rsptype">
		<xsl:attribute name="rsptype">
			<xsl:call-template name="brexmerge"/>
		</xsl:attribute>
	</xsl:template>

	<xsl:template match="//@skill">
		<xsl:attribute name="skill">
			<xsl:call-template name="brexmerge"/>
		</xsl:attribute>
	</xsl:template>

	<xsl:template match="//@sup.lev">
		<xsl:attribute name="sup.lev">
			<xsl:call-template name="brexmerge"/>
		</xsl:attribute>
	</xsl:template>

	<xsl:template match="//limit/@type">
		<xsl:attribute name="type">
			<xsl:call-template name="brexmerge"/>
		</xsl:attribute>
	</xsl:template>


	<xsl:template match="//@uom">
		<xsl:attribute name="uom">
			<xsl:call-template name="brexmerge"/>
		</xsl:attribute>
	</xsl:template>
</xsl:stylesheet><!-- Stylus Studio meta-information - (c) 2004-2006. Progress Software Corporation. All rights reserved.
<metaInformation>
<scenarios/><MapperMetaTag><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/><MapperBlockPosition></MapperBlockPosition><TemplateContext></TemplateContext><MapperFilter side="source"></MapperFilter></MapperMetaTag>
</metaInformation>
-->