<?xml version="1.0" encoding="UTF-8" ?>

<!--
	benr trial 1
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<!-- set the output properties -->
<xsl:output method="html"/>




<!-- root rule -->
<xsl:template match="/">
<HTML>
  <HEAD><TITLE>Audit Trail Data</TITLE></HEAD>
  <BODY BGColor="#FFFFFF" Text="#000000">
  <CENTER>
      <FONT FACE="Arial" SIZE="+5">
    	<B>Login/Logout Audit Trail</B>
      </FONT>
   <BR/>
   <BR/>
   <xsl:apply-templates/>
  <HR/>
  </CENTER>
  </BODY>
</HTML>
</xsl:template>

<!-- suppress non-selected nodes-->
<xsl:template match="*"/>

<!-- main rule for document element -->
<xsl:template match="audit">
		<table border="1">	
		<tr>
		<td><center>Date</center></td>
		<td><center>Event</center></td>
		<td><center>Host</center></td>
		<td><center>Audit UID</center></td>
		<td><center>Effective UID</center></td>
		<td><center>Effective GID</center></td>
		<td><center>Real UID</center></td>
		<td><center>Real GID</center></td>
		<td><center>PID</center></td>
		<td><center>Session ID</center></td>
		<td><center>Terminal ID</center></td>
		<td><center>Error Value</center></td>
		<td><center>Return Value</center></td>
		</tr>
	<xsl:apply-templates/>
		</table>
</xsl:template>



<xsl:template match="file">
			<B>File: </B>
			<I>time: </I>
			<xsl:choose>
				<xsl:when test="@time">
					<xsl:value-of select="@time"/>
					+ <xsl:value-of select="@msec"/>msec
				</xsl:when>
				<xsl:when test="@iso8601">
					<xsl:value-of select="@iso8601"/>
				</xsl:when>
			</xsl:choose>
			<BR/>
			<xsl:value-of select="."/>
   			<BR/>
   			<BR/>
</xsl:template>

<xsl:template match="record">
			<tr>
			<td>
			<xsl:choose>
				<xsl:when test="@time">
					<xsl:value-of select="@time"/>
					+ <xsl:value-of select="@msec"/>msec
				</xsl:when>
				<xsl:when test="@iso8601">
					<xsl:value-of select="@iso8601"/>
				</xsl:when>
			</xsl:choose>
			</td>
			<td><xsl:value-of select="@event"/></td>
	 		<td>host: <xsl:value-of select="@host"/></td>
   			<xsl:apply-templates/>
			</tr>
</xsl:template>





<!-- Start of handling for remaining tokens -->

<xsl:template match="path">
	<BR/>
	<I>PATH: </I>   <xsl:value-of select="."/>
</xsl:template>

<xsl:template match="path_attr">
	<BR/>
	<I>PATH_ATTR </I>
	<xsl:apply-templates/>
</xsl:template>

<xsl:template match="xattr">
	<BR/>
	<I>xattr: </I>   <xsl:value-of select="."/>
</xsl:template>

<xsl:template match="host">
	<BR/>
	<I>HOST: </I>   <xsl:value-of select="."/>
</xsl:template>

<xsl:template match="subject">
	<td color="#e1f4c2"><xsl:value-of select="@audit-uid"/></td>
	<td color="#e1f4c2"><xsl:value-of select="@uid"/></td>
	<td color="#e1f4c2"><xsl:value-of select="@gid"/></td>
	<td color="#e1f4c2"><xsl:value-of select="@ruid"/></td>
	<td color="#e1f4c2"><xsl:value-of select="@rgid"/></td>
	<td color="#e1f4c2"><xsl:value-of select="@pid"/></td>
	<td color="#e1f4c2"><xsl:value-of select="@sid"/></td>
	<td color="#e1f4c2"><xsl:value-of select="@tid"/></td>
</xsl:template>

<xsl:template match="return">
	<td color="#c2f4e4"><xsl:value-of select="@errval"/></td>
	<td color="#c2f4e4"><xsl:value-of select="@retval"/></td>
</xsl:template>

<xsl:template match="exit">
	<BR/>
	<I>EXIT </I>
	<I> errval: </I><xsl:value-of select="@errval"/>
	<I> retval: </I><xsl:value-of select="@retval"/>
</xsl:template>

<xsl:template match="sequence">
	<BR/>
	<I>SEQUENCE </I>
	<I> seq-num: </I><xsl:value-of select="@seq-num"/>
</xsl:template>

<xsl:template match="fmri">
	<BR/>
	<I>FMRI: </I>   <xsl:value-of select="."/>
</xsl:template>

<xsl:template match="group">
	<BR/>
	<I>GROUP </I>
	<xsl:apply-templates/>
</xsl:template>

<xsl:template match="gid">
	<BR/>
	<I>gid: </I>   <xsl:value-of select="."/>
</xsl:template>

<xsl:template match="opaque">
	<BR/>
	<I>OPAQUE: </I>   <xsl:value-of select="."/>
</xsl:template>

<xsl:template match="liaison">
	<BR/>
	<I>LIAISON: </I>   <xsl:value-of select="."/>
</xsl:template>

<xsl:template match="argument">
	<BR/>
	<I>ARGUMENT </I>
	<I> arg-num: </I><xsl:value-of select="@arg-num"/>
	<I> value: </I><xsl:value-of select="@value"/>
	<I> desc: </I><xsl:value-of select="@desc"/>
</xsl:template>

<xsl:template match="attribute">
	<BR/>
	<I>ATTRIBUTE </I>
	<I> mode: </I><xsl:value-of select="@mode"/>
	<I> uid: </I><xsl:value-of select="@uid"/>
	<I> gid: </I><xsl:value-of select="@gid"/>
	<I> fsid: </I><xsl:value-of select="@fsid"/>
	<I> nodeid: </I><xsl:value-of select="@nodeid"/>
	<I> device: </I><xsl:value-of select="@device"/>
</xsl:template>

<xsl:template match="cmd">
	<BR/>
	<I>CMD </I>
	<xsl:apply-templates/>
</xsl:template>

<xsl:template match="argv">
	<BR/>
	<I>argv: </I>   <xsl:value-of select="."/>
</xsl:template>

<xsl:template match="arge">
	<BR/>
	<I>arge: </I>   <xsl:value-of select="."/>
</xsl:template>

<xsl:template match="exec_args">
	<BR/>
	<I>EXEC_ARGS </I>
	<xsl:apply-templates/>
</xsl:template>

<xsl:template match="arg">
	<BR/>
	<I>arg: </I>   <xsl:value-of select="."/>
</xsl:template>

<xsl:template match="exec_env">
	<BR/>
	<I>EXEC_ENV </I>
	<xsl:apply-templates/>
</xsl:template>

<xsl:template match="env">
	<BR/>
	<I>env: </I>   <xsl:value-of select="."/>
</xsl:template>

<xsl:template match="arbitrary">
	<BR/>
	<I>ARBITRARY: </I>
	<I> print: </I><xsl:value-of select="@print"/>
	<I> type: </I><xsl:value-of select="@type"/>
	<I> count: </I><xsl:value-of select="@count"/>
	<BR/>
	<xsl:value-of select="."/>
</xsl:template>

<xsl:template match="privilege">
	<BR/>
	<I>PRIVILEGE: </I>
	<I> set-type: </I><xsl:value-of select="@set-type"/>
	<BR/>
	<xsl:value-of select="."/>
</xsl:template>

<xsl:template match="use_of_privilege">
	<BR/>
	<I>USE_OF_PRIVILEGE: </I>
	<I> result: </I><xsl:value-of select="@result"/>
	<BR/>
	<xsl:value-of select="."/>
</xsl:template>

<xsl:template match="sensitivity_label">
	<BR/>
	<I>SENSITIVITY_LABEL: </I>   <xsl:value-of select="."/>
</xsl:template>

<xsl:template match="use_of_authorization">
	<BR/>
	<I>USE_OF_AUTHORIZATION: </I>   <xsl:value-of select="."/>
</xsl:template>

<xsl:template match="IPC">
	<BR/>
	<I>IPC </I>
	<I> ipc-type: </I><xsl:value-of select="@ipc-type"/>
	<I> ipc-id: </I><xsl:value-of select="@ipc-id"/>
</xsl:template>

<xsl:template match="IPC_perm">
	<BR/>
	<I>IPC_PERM </I>
	<I> uid: </I><xsl:value-of select="@uid"/>
	<I> gid: </I><xsl:value-of select="@gid"/>
	<I> creator-uid: </I><xsl:value-of select="@creator-uid"/>
	<I> creator-gid: </I><xsl:value-of select="@creator-gid"/>
	<I> mode: </I><xsl:value-of select="@mode"/>
	<I> seq: </I><xsl:value-of select="@seq"/>
	<I> key: </I><xsl:value-of select="@key"/>
</xsl:template>

<xsl:template match="ip_address">
	<BR/>
	<I>IP_ADDRESS: </I>   <xsl:value-of select="."/>
</xsl:template>

<xsl:template match="ip_port">
	<BR/>
	<I>IP_PORT: </I>   <xsl:value-of select="."/>
</xsl:template>

<xsl:template match="ip">
	<BR/>
	<I>IP </I>
	<I> version: </I><xsl:value-of select="@version"/>
	<I> service_type: </I><xsl:value-of select="@service_type"/>
	<I> len: </I><xsl:value-of select="@len"/>
	<I> id: </I><xsl:value-of select="@id"/>
	<I> offset: </I><xsl:value-of select="@offset"/>
	<I> time_to_live: </I><xsl:value-of select="@time_to_live"/>
	<I> protocol: </I><xsl:value-of select="@protocol"/>
	<I> cksum: </I><xsl:value-of select="@cksum"/>
	<I> src_addr: </I><xsl:value-of select="@src_addr"/>
	<I> dest_addr: </I><xsl:value-of select="@dest_addr"/>
</xsl:template>

<xsl:template match="old_socket">
	<BR/>
	<I>OLD_SOCKET </I>
	<I> type: </I><xsl:value-of select="@type"/>
	<I> port: </I><xsl:value-of select="@port"/>
	<I> addr: </I><xsl:value-of select="@addr"/>
</xsl:template>

<xsl:template match="socket">
	<BR/>
	<I>SOCKET </I>
	<I> sock_domain: </I><xsl:value-of select="@sock_domain"/>
	<I> sock_type: </I><xsl:value-of select="@sock_type"/>
	<I> lport: </I><xsl:value-of select="@lport"/>
	<I> laddr: </I><xsl:value-of select="@laddr"/>
	<I> fport: </I><xsl:value-of select="@fport"/>
	<I> faddr: </I><xsl:value-of select="@faddr"/>
</xsl:template>

<xsl:template match="acl">
	<BR/>
	<I>ACL </I>
	<xsl:choose>
		<xsl:when test="@mode">	<!-- old ACL entry -->
			<I> type: </I><xsl:value-of select="@type"/>
			<I> value: </I><xsl:value-of select="@value"/>
			<I> mode: </I><xsl:value-of select="@mode"/>
		</xsl:when>
		<xsl:otherwise>
			<I> flags: </I><xsl:value-of select="@flags"/>
			<I> id: </I><xsl:value-of select="@id"/>
			<I> access_mask: </I><xsl:value-of select="@access_mask"/>
			<I> type: </I><xsl:value-of select="@type"/>
		</xsl:otherwise>
	</xsl:choose>
</xsl:template>

<xsl:template match="tid">
	<BR/>
	<I>terminal id: </I>
	<I> type=</I><xsl:value-of select="@type"/>
	<xsl:apply-templates/>
</xsl:template>

<xsl:template match="ipadr">
	<I> local-port: </I><xsl:value-of select="@local-port"/>
	<I> remote-port: </I><xsl:value-of select="@remote-port"/>
	<I> host: </I><xsl:value-of select="@host"/>
</xsl:template>

<xsl:template match="X_atom">
	<BR/>
	<I>X_ATOM: </I>   <xsl:value-of select="."/>
</xsl:template>

<xsl:template match="X_color_map">
	<BR/>
	<I>X_COLOR_MAP </I>
	<I> xid: </I><xsl:value-of select="@xid"/><I> xcreator-uid: </I><xsl:value-of select="@xcreator-uid"/>
</xsl:template>

<xsl:template match="X_cursor">
	<BR/>
	<I>X_CURSOR </I>
	<I> xid: </I><xsl:value-of select="@xid"/><I> xcreator-uid: </I><xsl:value-of select="@xcreator-uid"/>
</xsl:template>

<xsl:template match="X_font">
	<BR/>
	<I>X_FONT </I>
	<I> xid: </I><xsl:value-of select="@xid"/><I> xcreator-uid: </I><xsl:value-of select="@xcreator-uid"/>
</xsl:template>

<xsl:template match="X_graphic_context">
	<BR/>
	<I>X_GRAPHIC_CONTEXT </I>
	<I> xid: </I><xsl:value-of select="@xid"/><I> xcreator-uid: </I><xsl:value-of select="@xcreator-uid"/>
</xsl:template>

<xsl:template match="X_pixmap">
	<BR/>
	<I>X_PIXMAP </I>
	<I> xid: </I><xsl:value-of select="@xid"/><I> xcreator-uid: </I><xsl:value-of select="@xcreator-uid"/>
</xsl:template>

<xsl:template match="X_window">
	<BR/>
	<I>X_WINDOW </I>
	<I> xid: </I><xsl:value-of select="@xid"/><I> xcreator-uid: </I><xsl:value-of select="@xcreator-uid"/>
</xsl:template>

<xsl:template match="X_property">
	<BR/>
	<I>X_PROPERTY: </I>
	<I> xid: </I><xsl:value-of select="@xid"/><I> xcreator-uid: </I><xsl:value-of select="@xcreator-uid"/>
	<BR/>
	<xsl:value-of select="."/>
</xsl:template>

<xsl:template match="X_client">
	<BR/>
	<I>X_CLIENT: </I>   <xsl:value-of select="."/>
</xsl:template>

<xsl:template match="X_selection">
	<BR/>
	<I>X_SELECTION </I>
	<xsl:apply-templates/>
</xsl:template>

<xsl:template match="x_sel_text">
	<BR/>
	<I>x_sel_text: </I>   <xsl:value-of select="."/>
</xsl:template>

<xsl:template match="x_sel_type">
	<BR/>
	<I>x_sel_type: </I>   <xsl:value-of select="."/>
</xsl:template>

<xsl:template match="x_sel_data">
	<BR/>
	<I>x_sel_data: </I>   <xsl:value-of select="."/>
</xsl:template>

<xsl:template match="zone">
	<BR/>
	<I>ZONE </I>
	<I> name: </I><xsl:value-of select="@name"/>
</xsl:template>

</xsl:stylesheet>

