<?xml version="1.0" encoding="utf-16"?>
<?xml-stylesheet type="text/xsl" href="#stylesheet"?>
<activity>
	<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" id="stylesheet" xml:id="stylesheet">
		<xsl:output method="html"  encoding="utf-16"/>
		<!-- Don't reprint text nodes within the xsl:stylesheet node -->
		<xsl:template match="text()"/>
		<xsl:template match="activity">
			<head>
				<title>Activity Monitor Log</title>
				<style type="text/css">
					body{ text-align: left; width: 100%;  font-family: Verdana, sans-serif; }

					table{ border: none;  border-collapse: separate;  width: 100%; }

					tr.title td{ font-size: 24px;  font-weight: bold; }

					th{ background: #d0d0d0;  font-weight: bold;  font-size: 10pt;  text-align: left; }
					tr{ background: #eeeeee}
					td, th{ font-size: 8pt;  padding: 1px;  border: none; }

					tr.info td{}
					tr.warning td{background-color:yellow;color:black}
					tr.error td{background-color:red;color:black}

					span {text-decoration:underline}
					a:hover{text-transform:uppercase;color: #9090F0;}
				</style>
			</head>

			<body>
				<table>
					<tr class="title">
						<td colspan="7">Activity Monitor Log</td>
					</tr>
					<tr>
						<td colspan="2">infos</td>
						<td colspan="5">
							<xsl:value-of select="count(entry[type='Information'])"/>
						</td>
					</tr>
					<tr>
						<td colspan="2">warnings</td>
						<td colspan="5">
							<xsl:value-of select="count(entry[type='Warning'])"/>
						</td>
					</tr>
					<tr>
						<td colspan="2">errors</td>
						<td colspan="5">
							<xsl:value-of select="count(entry[type='Error'])"/>
						</td>
					</tr>
					<tr>
						<th width="20">#</th>
						<th width="50">Type</th>
						<th>Description</th>
						<th width="280">GUID</th>
						<th>Hr</th>
						<th>Source</th>
						<th>Time (UTC)</th>
					</tr>
					<xsl:apply-templates/>
				</table>

			</body>
		</xsl:template>

		<xsl:template match="entry">
			<!-- example 

          <entry>
            <record>136</record>
            <time>2004/02/26 00:42:59.706</time>
            <type>Error</type>
            <source>Microsoft Visual Studio</source>
            <description>Loading UI library</description>
            <guid>{00000000-0000-0000-0000-000000000000}</guid>
            <hr>800a006f</hr>
            <path></path>
        </entry>

        -->
			<xsl:choose>

				<xsl:when test="type='Information'">
					<tr id="info" class="info">
						<td>
							<xsl:value-of select="record"/>
						</td>
						<td></td>
						<xsl:call-template name="row"/>
					</tr>
				</xsl:when>

				<xsl:when test="type='Warning'">
					<tr id="warning" class="warning">
						<td>
							<xsl:value-of select="record"/>
						</td>
						<td>Warning</td>
						<xsl:call-template name="row"/>
					</tr>
				</xsl:when>

				<xsl:when test="type='Error'">
					<tr id="error" class="error">
						<td>
							<xsl:value-of select="record"/>
						</td>
						<td>ERROR</td>
						<xsl:call-template name="row"/>
					</tr>
				</xsl:when>

			</xsl:choose>

		</xsl:template>

		<xsl:template name="row">
			<td id="description">
				<xsl:value-of select="description"/>
				<xsl:if test="path">
					<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<xsl:value-of select="path"/>
				</xsl:if>
			</td>
			<td id="guid">
				<xsl:value-of select="guid"/>
			</td>
			<td id="hr">
				<xsl:value-of select="hr"/>
			</td>
			<td>
				<xsl:value-of select="source"/>
			</td>
			<td>
				<xsl:value-of select="time"/>
			</td>
		</xsl:template>

	</xsl:stylesheet>

  <entry>
    <record>1</record>
    <time>2023/01/21 14:40:21.328</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Microsoft Visual Studio 2022 version: 17.0.33213.231</description>
  </entry>
  <entry>
    <record>2</record>
    <time>2023/01/21 14:40:21.328</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Log ID</description>
    <guid>{3D1682C0-ED0C-4C7F-A3B0-7E57485FF215}</guid>
  </entry>
  <entry>
    <record>3</record>
    <time>2023/01/21 14:40:21.328</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Running in traditional mode.</description>
    <hr>0x80070002</hr>
  </entry>
  <entry>
    <record>4</record>
    <time>2023/01/21 14:40:21.330</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Creating PkgDefCacheNonVolatile</description>
  </entry>
  <entry>
    <record>5</record>
    <time>2023/01/21 14:40:21.330</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>PkgDefCache flags</description>
    <hr>0x00011801</hr>
  </entry>
  <entry>
    <record>6</record>
    <time>2023/01/21 14:40:21.330</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Double-checking master pkgdef file</description>
  </entry>
  <entry>
    <record>7</record>
    <time>2023/01/21 14:40:21.330</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Looking for master PkgDef file</description>
    <path>C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\master.pkgdef</path>
  </entry>
  <entry>
    <record>8</record>
    <time>2023/01/21 14:40:21.331</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>PkgDefManagement initialized</description>
  </entry>
  <entry>
    <record>9</record>
    <time>2023/01/21 14:40:21.331</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>RootFolder</description>
    <path>C:\Program Files\Microsoft Visual Studio\2022\Community\</path>
  </entry>
  <entry>
    <record>10</record>
    <time>2023/01/21 14:40:21.331</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>ShellFolder</description>
    <path>C:\Program Files\Microsoft Visual Studio\2022\Community\</path>
  </entry>
  <entry>
    <record>11</record>
    <time>2023/01/21 14:40:21.331</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>PkgDefSearchPath</description>
    <path>C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\Extensions;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\devenv.admin.pkgdef</path>
  </entry>
  <entry>
    <record>12</record>
    <time>2023/01/21 14:40:21.331</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>ImageManifestSearchPath</description>
    <path>C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\Extensions;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions;C:\Users\HP\AppData\Local\Microsoft\VisualStudio\17.0\Extensions</path>
  </entry>
  <entry>
    <record>13</record>
    <time>2023/01/21 14:40:21.331</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>ApplicationExtensionsFolder</description>
    <path>C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\Extensions</path>
  </entry>
  <entry>
    <record>14</record>
    <time>2023/01/21 14:40:21.331</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>&quot;ZeroImpact&quot; = dword:0, &quot;MergeRegistry&quot; = dword:1</description>
  </entry>
  <entry>
    <record>15</record>
    <time>2023/01/21 14:40:21.335</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>AppId stopped registry detouring</description>
  </entry>
  <entry>
    <record>16</record>
    <time>2023/01/21 14:40:21.335</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Shutting down pkgdef registry</description>
  </entry>
  <entry>
    <record>17</record>
    <time>2023/01/21 14:40:21.335</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>PkgDef registry shutdown complete</description>
  </entry>
</activity>
