<xsl:stylesheet

  version="1.0"

  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

  xmlns:mml="http://www.w3.org/1998/Math/MathML"

  xmlns:h="http://www.w3.org/1999/xhtml"

  xmlns="http://www.w3.org/1999/xhtml"

  xmlns:xlink="http://www.w3.org/1999/xlink"

  exclude-result-prefixes="h xlink"

>



<xsl:template match="h:html">

<html>

<xsl:copy-of select="@*"/>

<xsl:apply-templates/>

</html>

</xsl:template>



<xsl:template match="h:head">

<xsl:copy>

<xsl:choose>

<xsl:when test="system-property('xsl:vendor')='Microsoft'">

<object id="mmlFactory" 

        classid="clsid:32F66A20-7614-11D4-BD11-00104BD3F987">

</object>

<xsl:processing-instruction name="import">

 namespace="mml" implementation="#mmlFactory"

</xsl:processing-instruction>

</xsl:when>

<xsl:when  test="system-property('xsl:vendor')='Opera' or system-property('xsl:vendor')='libxslt'">

<link rel="stylesheet" href="../styles/operamath.css" type="text/css"/>

 </xsl:when>

</xsl:choose>

<xsl:copy-of select="node()"/>

 <style>



#menu-noscript {

margin: 0;

padding: 0;

background: #fff;

color: #666;

font-family: Verdana, Arial, Helvetica, sans-serif;

font-size: 10px;

font-weight: bold;

}



#menu-noscript ul {

margin: 0; padding: 0;

}









.toptable {

color: #ffffff;

font-size: 80%;

font-family: verdana, arial, sans-serif;

font-weight: bold;

background: #333399;

padding: 1em 1em 1em 1em;

}







.toptablesmall {

color: #ffffff;

font-size: 10px;

font-weight: bold;

background: #333399;

padding: 10px 5px 0px 5px;

}



div.toptable-r {

position: absolute;

right: 1em;

top: 2em;

}





.toptable  a:link {color: #ffffff; text-decoration: none;}

.toptable  a:visited {color: #ffffff; text-decoration: none;}

.toptable  a:active {color: #ffffff; text-decoration: none;}

.toptable  a:hover {color: #ffffff; text-decoration: none;}

.toptable img { border:none ;}





#nav { width:100%;

        font-size: 0.75em;

	border: solid #FFCC33;

	border-width: 0 0px 5px 0;

      font-family: Verdana, Arial, Helvetica, sans-serif;

}



#nav ul {

	float: left;

	width: 95%;

	list-style: none;

	line-height: 1;

	background: white;

	font-weight: bold;

	padding: 0 0 0 0;

	margin: 0 0 0 0;

}



#nav a {

	display: block;

	width: 100%;

        text-align: center;

        color: black;

	text-decoration: none;

	padding: 0.25em 0.25em 0.2em 0.2em;

}

#nav li {

	float: left;

	padding: 0;

	width: 14%;

}



#nav li:hover, #nav li.sfhover {

	background: #FFCC33;

}

</style>

</xsl:copy>

</xsl:template>



<xsl:template match="h:body">

<xsl:copy>

<div class="noprint">



<div class="toptable">

<div>

<a href="/index.asp"><img src="/images/naglogowhite.gif" alt="NAG Logo"/></a>

<br clear="all"/>

Numerical Algorithms Group

</div>

<div  class="toptable-r">



<xsl:element name="form">

<xsl:attribute name="style">display: inline;</xsl:attribute>

<xsl:attribute name="method">GET</xsl:attribute>

<xsl:attribute name="action">http://www.google.com/custom</xsl:attribute>

	<input type="text" name="q" size="25" maxlength="255" value="" style="border: #000080 1px solid" align="middle"/>

    <input type="image" src="/images/search.gif" name="sa" alt="Search" align="middle"/>  

    <input type="hidden" name="cof" 	value="LW:250;L:http://www.nag.com/images/nag.gif;LH:121;AH:center;S:http://www.nag.com;AWFID:e770b82fe001a92d;"/>

    <input type="hidden" name="domains" value="www.nag.com"/>

    <input type="hidden" name="sitesearch" value="www.nag.com"/>

</xsl:element>

<div class="toptablesmall">     

<img src="/images/yelsmaarr.gif" alt="arrow"/><a href="/webstore.asp" class="toptablesmall">Web Store</a>

<img src="/images/yelsmaarr.gif" alt="arrow"/><a href="/contact_us.asp" class="toptablesmall">Contact Us</a>

<img src="/images/yelsmaarr.gif" alt="arrow"/><a href="/Market/request_info.asp" class="toptablesmall">Contact Us</a>

<img src="/images/yelsmaarr.gif" alt="arrow"/><a href="/Advisory/web_site_index.asp" class="toptablesmall">Site Map</a>

<br/> 

</div>

</div>

</div>





<div id="nav">

<!-- menu here -->



<ul>

<li><a href="/products_and_services.asp">PRODUCTS</a></li>

<li><a href="/Forms/support.asp">SUPPORT</a></li>

<li><a href="/downloads/index.asp">DOWNLOADS</a></li>

<li><a href="/main_industries.asp">INDUSTRY FOCUS</a></li>

<li><a href="/bdu/index.asp">PARTNERS</a></li>

<li><a href="/Market/pressroom.asp">RESOURCES</a></li>

<li><a href="/about_nag.asp">ABOUT NAG</a></li>

</ul>



<br style="clear:left"/>



</div>





</div> <!-- for no header printing -->



<p>Prototype documentation in XHTML+MathML format. See the <a href="/numeric/FL/manual/html/genint/fl_onlinehelp.html">online help document</a> for advice on viewing this format.</p>







<xsl:apply-templates/>



</xsl:copy>

</xsl:template>



<xsl:template match="*">

<xsl:copy>

<xsl:copy-of select="@*"/>

<xsl:apply-templates/>

</xsl:copy>

</xsl:template>



<xsl:template match="h:br|h:hr">

<xsl:choose>

<xsl:when test="system-property('xsl:vendor')='Microsoft'">

  <xsl:value-of disable-output-escaping="yes" select="concat('&lt;',local-name(.))"/>

  <xsl:apply-templates mode="verb" select="@*"/>

  <xsl:text disable-output-escaping="yes">&gt;</xsl:text>

</xsl:when>

<xsl:otherwise>

<xsl:element name="{local-name(.)}">

 <xsl:copy-of select="@*"/>

<xsl:apply-templates/>

</xsl:element>

</xsl:otherwise>

</xsl:choose>

</xsl:template>



<xsl:template match="mml:*">

<xsl:element name="mml:{local-name(.)}">

 <xsl:copy-of select="@*"/>

<xsl:apply-templates/>

</xsl:element>

</xsl:template>



<xsl:template match="mml:math">

  <xsl:choose>

    <xsl:when test="system-property('xsl:vendor')='Opera'">

      <xsl:apply-templates select="." mode="opera"/>

    </xsl:when>

    <xsl:when test="system-property('xsl:vendor')='libxslt'">

      <xsl:apply-templates select="." mode="opera"/>

    </xsl:when>

    <xsl:otherwise>

      <xsl:element name="mml:{local-name(.)}">

	<xsl:copy-of select="@*"/>

	<xsl:apply-templates/>

      </xsl:element>

    </xsl:otherwise>

  </xsl:choose>

</xsl:template>





<xsl:template match="mml:*" mode="opera">

  <xsl:element name="{local-name(.)}">

    <xsl:copy-of select="@*"/>

    <xsl:apply-templates mode="opera"/>

  </xsl:element>

</xsl:template>



<xsl:template match="mml:mfrac" mode="opera">

  <xsl:element name="{local-name(.)}">

    <xsl:copy-of select="@*"/>

    <mrow><xsl:apply-templates mode="opera" select="*[1]"/></mrow>

    <mrow><xsl:apply-templates mode="opera" select="*[2]"/></mrow>

  </xsl:element>

</xsl:template>



<xsl:template match="mml:msub" mode="opera">

  <xsl:element name="{local-name(.)}">

    <xsl:copy-of select="@*"/>

    <mrow><xsl:apply-templates mode="opera" select="*[1]"/></mrow>

    <mrow><xsl:apply-templates mode="opera" select="*[2]"/></mrow>

  </xsl:element>

</xsl:template>



<xsl:template match="mml:mfenced[not(.//mml:mtable or .//mml:mfrac)]" mode="opera" priority="2">

    <mrow>

      <mo>

	<xsl:choose>

	  <xsl:when test="@open"><xsl:value-of select="@open"/></xsl:when>

	  <xsl:otherwise>(</xsl:otherwise>

	</xsl:choose>

      </mo>

      <xsl:for-each select="*">

	<xsl:apply-templates mode="opera" select="."/>

	<xsl:if test="not(@separators='') and position()!=last()">

	  <mo><xsl:value-of select="../@separators"/></mo>

	</xsl:if>

      </xsl:for-each>

      <mo>

	<xsl:choose>

	  <xsl:when test="@close"><xsl:value-of select="@close"/></xsl:when>

	  <xsl:otherwise>)</xsl:otherwise>

	</xsl:choose>

      </mo>

    </mrow>

</xsl:template>



<xsl:template match="mml:mfenced" mode="opera">

  <xsl:element name="{local-name(.)}">

    <xsl:copy-of select="@*"/>

    <xsl:attribute name="separators"/>

    <mrow>

      <xsl:for-each select="*">

	<xsl:apply-templates mode="opera" select="."/>

	<xsl:if test="not(@separators='') and position()!=last()">

	  <mo><xsl:value-of select="../@separators"/></mo>

	</xsl:if>

      </xsl:for-each>

    </mrow>

  </xsl:element>

</xsl:template>



<xsl:template match="mml:mfenced[@open='&#8214;' and @close='&#8214;']" mode="opera">

     <mrow class="vert">

	<mrow class="vert">

	<xsl:apply-templates mode="opera" select="*"/></mrow>

    </mrow>

</xsl:template>



<xsl:template match="mml:mi" mode="opera">

  <xsl:element name="{local-name(.)}">

    <xsl:copy-of select="@*"/>

    <xsl:if test="not(@mathvariant) and string-length(.)=1">

      <xsl:attribute name="mathvariant">italic</xsl:attribute>

    </xsl:if>

    <xsl:if test="@mathvariant='bold' and string-length(.)=1">

      <xsl:attribute name="mathvariant">bold-italic</xsl:attribute>

    </xsl:if>

    <xsl:if test="not(@style) and @mathcolor">

      <xsl:attribute name="style">color: <xsl:value-of select="@mathcolor"/>;</xsl:attribute>

    </xsl:if>

    <xsl:apply-templates mode="opera" select="node()"/>

  </xsl:element>

</xsl:template>



<xsl:template match="mml:mo[.='&#8289;']" mode="opera">

  <mo><xsl:text> </xsl:text></mo>

</xsl:template>



<xsl:template match="mml:maction[@actiontype='link']" mode="opera">

 <a style="text-decoration: none;"  href="{@xlink:href}">

    <xsl:apply-templates mode="opera" select="*"/>

 </a>

</xsl:template>





</xsl:stylesheet>


