Nokia Networks Home

Nokia nmake Product Builder

Quick Links

Related Products

Tool Repository

[ tool index ]

makefiles.xsl

Reports information in HTML format about each makefile built.

Download makefiles.xsl

Description

makefiles.xsl is an XSLT script that outputs an HTML document containing a table having a row for each makefile run during the build. The fields displayed in each row are make recursion level, directory relative to a specified root, and makefile execution start and end times. This is an example XSLT script from the Build Log Overview.

Requirements

xsltproc (available in exptools) or other XSLT processors should work. xsltproc is a widely used command available on many platforms including Linux, Solaris, Cygwin, and Windows.

Usage

xsltproc targets.xsl filename.xml

Example Command Line

xsltproc makefiles.xsl makelog.xml

Example Output

See the Extended Example in the Build Log Overview for details and structure of the example build used.

<html>
  <head>
    <title>Triggered makefiles</title>
  </head>
  <body>
    <h1>Triggered makefiles</h1>
    <table>
      <tr>
        <th>makelevel</th>
        <th>pwd</th>
        <th>start time</th>
        <th>end time</th>
      </tr>
      <tr>
        <td>0</td>
        <td>src</td>
        <td>17:11:21.14</td>
        <td>17:11:21.58</td>
      </tr>
      <tr>
        <td>1</td>
        <td>src/cmd</td>
        <td>17:11:21.20</td>
        <td>17:11:21.55</td>
      </tr>
      <tr>
        <td>2</td>
        <td>src/cmd/hw</td>
        <td>17:11:21.25</td>
        <td>17:11:21.51</td>
      </tr>
    </table>
  </body>
</html>

Script

The basic structure is similar to targets.xsl: the apply-templates select="//makelog" instruction recursively finds all makelog elements and causes the template match="makelog" to run once per found element. HTML tags in the templates are output verbatim; XPath expressons such as makeinfo/makelevel pull out the needed parts of the input tree for output. These expressions are similar to Unix directory paths and are relative to the current XML document node, in this case the makelog node of the current template invocation. See also the Build Log Overview.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
	<xsl:variable name="root" select="'ex1/'"/>

	<xsl:template match="/">
		<html>
			<head>
				<title>Triggered makefiles</title>
			</head>
			<body>
				<h1>Triggered makefiles</h1>
				<table>
					<tr>
						<th>makelevel</th>
						<th>pwd</th>
						<th>start time</th>
						<th>end time</th>
					</tr>
					<xsl:apply-templates select="//makelog"/>
				</table>
			</body>
		</html>
	</xsl:template>
	
	<xsl:template match="makelog">
		<tr>
			<td><xsl:value-of select='makeinfo/makelevel' /></td>
			<td><xsl:value-of select='substring-after(makeinfo/pwd, $root)' /></td>
			<td><xsl:value-of select='substring(makeinfo/stime, 12, 11)' /></td>
			<td><xsl:value-of select='substring(makeinfo/etime, 12, 11)' /></td>
		</tr>
	</xsl:template>
	
</xsl:stylesheet>
Last Update: Friday,12-Aug-2016 12:16:48 EDT