home *** CD-ROM | disk | FTP | other *** search
Wrap
<?xml version="1.0" encoding="windows-1252"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:z="#RowsetSchema"> <xsl:output method="html" indent="yes" encoding="UTF-8"/> <xsl:param name="GraphicsPath"/> <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> <xsl:template match="/"> <html> <head> <title>LNSS Reporter</title> <style> <xsl:value-of select="document('css.xml')/stylesheets/style[@id='default']"/> </style> <script language='VBScript'> <![CDATA[ function toggle( obj, img ) set oImg = document.all.item(img) set oObj = document.all.item(obj) if oObj.style.display = "none" then oObj.style.display = "" OImg.src = "]]><xsl:value-of select="$GraphicsPath"/><![CDATA[\minus.gif" else oObj.style.display = "none" oImg.src = "]]><xsl:value-of select="$GraphicsPath"/><![CDATA[\plus.gif" end if end function ]]> </script> </head> <!-- body begins --> <body bgcolor="#ffffff" topmargin="0" leftmargin="0" rightmargin="0"> <!-- top bar --> <table width="100%" border="0" cellpadding="0" cellspacing="0" height="0"> <tr> <td> <div align="left"><img src="{$GraphicsPath}\top_menu_left.gif" border="0" hspace="10" alt="GFI"/></div> </td> <td> <div align="right"><img src="{$GraphicsPath}\top_menu_right.jpg" border="0"/></div> </td> </tr> <tr> <td bgcolor="#000000" colspan="2" height="2"></td> </tr> </table> <!-- Table that encapsulates all other details --> <table cellpadding="0" cellspacing="0" style="border-collapse: collapse" border="0" width="98%" align="center"> <tr><td> <!-- report title --> <div align="center"> <table cellpadding="0" cellspacing="0" border="0" width="100%" style="border-collapse: collapse"> <tr><td class="MainHeading">Hosts Running SQL Sub-Report</td></tr> </table> </div> <xsl:for-each select="/xml/rs:data/z:row[(position()=1) or (@CreatedDate != preceding-sibling::z:row[position()=1]/@CreatedDate)]"> <xsl:call-template name="CreatedOn"/> </xsl:for-each> </td></tr> </table> <table width="100%" border="0" cellpadding="0" cellspacing="0" height="0"> <tr> <td bgcolor="#000000" width="10"></td> <td bgcolor="#000000" align="left" valign="center" height="20" class="normal" style="color:white"><xsl:text disable-output-escaping="yes">© 2005. All rights reserved. GFI Software Ltd.</xsl:text></td> </tr> </table> </body> </html> </xsl:template> <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> <!-- created to override default template --> <xsl:template match="text() | @*"> <!-- do nothing --> </xsl:template> <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> <xsl:template match="s:AttributeType"> <td class="HEADERS"> <xsl:value-of select="@name"/> </td> </xsl:template> <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> <xsl:template name="CreatedOn"> <xsl:variable name="CreateDate" select="@CreatedDate"/> <xsl:variable name="position" select="position()"/> <xsl:if test="position()=1 or (@CreatedDate != preceding-sibling::z:row[position()=1]/@CreatedDate)"> <div align="center"> <table cellpadding="0" cellspacing="1" border="0" width="100%" style="border-collapse: collapse;"> <tr> <td width='33%' class="MainTableHeader">Date and Time of Scan</td> <td width='33%' class="MainTableHeader">Number of Hosts</td> <td width='33%' class="MainTableHeader">Scan Target</td> </tr> <tr> <td align="left" class="TableItem0" valign="top"> <!--xsl:value-of select="@CreatedDate"/--> <xsl:value-of select="concat(substring-before(@CreatedDate, 'T'), ' ', substring-after(@CreatedDate,'T'))"/> </td> <td align="left" class="TableItem0" valign="top"><xsl:value-of select="@IPCount"/></td> <td align="left" class="TableItem0" valign="top"><xsl:value-of select="@ScanTarget"/></td> </tr> </table> </div> <br/> <div align="center"> <table cellpadding="0" cellspacing="1" border="0" width="100%" style="border-collapse: collapse"> <tr> <td width="10" class="TableHeader"></td> <td class="TableHeader">Machines</td> </tr> <tr> <td/> <td> <!-- machines here --> <table cellpadding='0' cellspacing='1' border='0' width='100%' style='border-collapse: collapse;'> <tr> <td width="10" class="TableHeader"></td> <td class="TableHeader">IP Address</td> <td class="TableHeader">Machine Name</td> <td class="TableHeader">MAC Address</td> <td class="TableHeader">Domain</td> <td class="TableHeader">Operating System</td> <td class="TableHeader">Service Pack</td> </tr> <xsl:for-each select="/xml/rs:data/z:row[(@CreatedDate=$CreateDate)and((position()=1) or (@CreatedDate != preceding-sibling::z:row [position()=1]/@CreatedDate) or (@IP != preceding-sibling::z:row[position()=1]/@IP))]"> <xsl:call-template name="IP"> <xsl:with-param name="index" select="$position"/> </xsl:call-template> </xsl:for-each> </table> </td> </tr> </table> </div> <hr/><br/> </xsl:if> </xsl:template> <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> <xsl:template name="IP"> <xsl:param name="index"/> <xsl:variable name="CreateDate" select="@CreatedDate"/> <xsl:variable name="CurrentIP" select="@IP"/> <xsl:if test="position()=1 or (@CreatedDate != preceding-sibling::z:row[position()=1]/@CreatedDate) or (@IP != preceding-sibling::z:row[position()=1]/@IP)"> <tr> <td width='10' class="TableItem{position() mod 2}"><div style="cursor: hand;" onclick="toggle 'Mach{$index}{position()}', 'Mach{$index}{position()}Img'"><img id="Mach{$index}{position()}Img" src="{$GraphicsPath}\minus.gif" title='SQL Server' alt='SQL Server' height='12' width='12'/></div></td> <td class="TableItem{position() mod 2}"><xsl:value-of select="@IP"/></td> <td class="TableItem{position() mod 2}"><xsl:value-of select="@HostName"/></td> <td class="TableItem{position() mod 2}"><xsl:value-of select="@MAC"/></td> <td class="TableItem{position() mod 2}"><xsl:value-of select="@Domain"/></td> <td class="TableItem{position() mod 2}"><xsl:value-of select="@OS"/></td> <td class="TableItem{position() mod 2}"><xsl:value-of select="@ServPack"/></td> </tr> </xsl:if> <xsl:variable name="IDStr">Mach<xsl:value-of select="$index"/><xsl:value-of select="position()"/></xsl:variable> <tr id='Mach{$index}{position()}'> <td/> <td colspan='6'> <table cellpadding='0' cellspacing='1' border='0' width='100%' style='border-collapse: collapse;'> <tr> <td width="10" class="TableHeader"/> <td class="TableHeader">SQL Server</td> </tr> <xsl:for-each select="/xml/rs:data/z:row[(@CreatedDate=$CreateDate)and(@IP=$CurrentIP)and((position()=1) or (@CreatedDate != preceding-sibling::z:row[position()=1]/@CreatedDate) or (@IP != preceding-sibling::z:row[position()=1]/@IP) or (@ProdName != preceding-sibling::z:row[position()=1]/@ProdName))]"> <xsl:call-template name="SQL"> <xsl:with-param name="index"><xsl:value-of select="$IDStr"/></xsl:with-param> </xsl:call-template> </xsl:for-each> </table> </td> </tr> </xsl:template> <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> <xsl:template name="SQL"> <xsl:param name="index"/> <xsl:variable name="CreateDate" select="@CreatedDate"/> <xsl:variable name="CurrentIIS" select="@ProdName"/> <xsl:variable name="CurrentIP" select="@IP"/> <xsl:if test="position()=1 or (@CreatedOn != preceding-sibling::z:row[position()=1]/@CreatedOn) or (@IP != preceding-sibling::z:row[position()=1]/@IP) or (@ProdName != preceding-sibling::z:row[position()=1]/@ProdName)"> <tr> <td class="TableItem0"><div style="cursor: hand;" onclick="toggle 'SQL{$index}{position()}', 'SQL{$index}{position()}Img'"><img id="SQL{$index}{position()}Img" src="{$GraphicsPath}\plus.gif" title='Vulnerabilities' alt='Vulnerabilities' height='12' width='12'/></div></td> <td class="TableItem0"><xsl:value-of select="@ProdName"/></td> </tr> <xsl:variable name="IDStr">SQL<xsl:value-of select="$index"/><xsl:value-of select="position()"/></xsl:variable> <tr id='SQL{$index}{position()}' style='display:none;'> <td/> <td> <!-- Missing Hotfixes --> <table cellpadding='0' cellspacing='1' border='0' width='100%' style='border-collapse: collapse;'> <tr> <td class="TableHeader" width='200'>Missing Hotfix Name</td> <td class="TableHeader">Details</td> <td class="TableHeader">Posted Date</td> </tr> <xsl:for-each select="/xml/rs:data/z:row[(@CreatedDate=$CreateDate)and(@IP=$CurrentIP)and(@ProdName=$CurrentIIS)]"> <xsl:call-template name="Name"/> </xsl:for-each> <tr> <td height="7"/> <td height="7"/> </tr> </table> </td> </tr> </xsl:if> </xsl:template> <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> <xsl:template name="Name"> <tr> <td align="left" class="TableItem{position() mod 2}" title='{@URL}'><a href='{@URL}' target='_blank'><xsl:value-of select="@Name"/></a></td> <td align="left" class="TableItem{position() mod 2}"><xsl:value-of select="@Description"/></td> <td align="left" class="TableItem{position() mod 2}"><xsl:value-of select="@DatePosted"/></td> </tr> </xsl:template> </xsl:stylesheet>