Server IP : 180.180.241.3 / Your IP : 216.73.216.252 Web Server : Microsoft-IIS/7.5 System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586 User : IUSR ( 0) PHP Version : 5.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /ProgramData/Sophos/AutoUpdate/data/warehouse/ |
Upload File : |
<?xml version="1.0" encoding="utf-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/dev/null"> <!-- Last-ditch effort to display something legible on IE 5. No localisation available. This template will never match, but it shows up in the mangled output from MSXML1. --> <html> <head> <title>RMS status report</title> <link rel="stylesheet" type="text/css" href="report-style.css" /> <!-- Using the 'type' attribute requires HTML 4 --> </head> <body> <h1>Internet Explorer cannot display the report file directly.</h1> <p>To view the status report XML file directly, please upgrade to Internet Explorer 6, install the latest version of the Microsoft XML Parser or use a different browser.</p> </body> </html> </xsl:template> <!-- Generate HTML 4.01 output --> <xsl:output method="html" encoding="UTF-8" indent="yes" doctype-public="-//W3C//DTD HTML 4.01//EN" doctype-system="http://www.w3.org/TR/html4/strict.dtd" /> <xsl:template match="/RMS_status_report/computer_data/language"><!-- hide --></xsl:template> <xsl:param name="Lang" select="normalize-space(/RMS_status_report/computer_data/language/text())" /> <xsl:param name="origin" /> <xsl:variable name="StringFile" select="document('strings.xml')" /> <xsl:variable name="PrimaryLang" select="substring-before($Lang, '_')" /> <!-- The localisation magic --> <xsl:template match="string"> <xsl:call-template name="getString"> <xsl:with-param name="stringName" select="@msg" /> </xsl:call-template> </xsl:template> <xsl:template match="section/string"> <tr> <th> <xsl:call-template name="getString"> <xsl:with-param name="stringName" select="@msg" /> </xsl:call-template> </th> <td></td> </tr> </xsl:template> <!-- The localised string selector --> <xsl:template name="getString"> <xsl:param name="stringName" /> <xsl:variable name="str" select="$StringFile/strings/str[@name=$stringName]" /> <xsl:choose> <xsl:when test="$str[lang($Lang)]"> <xsl:value-of select="$str[lang($Lang)][1]" /> </xsl:when> <xsl:when test="$str[lang($PrimaryLang)]"> <xsl:value-of select="$str[lang($PrimaryLang)][1]" /> </xsl:when> <xsl:when test="$str"> <xsl:value-of select="$str[1]" /> </xsl:when> <xsl:otherwise> <xsl:message terminate="no"> <xsl:text>Warning: no string named '</xsl:text> <xsl:value-of select="$stringName" /> <xsl:text>' found.</xsl:text> </xsl:message> <xsl:text>[</xsl:text> <xsl:value-of select="$stringName" /> <!-- The ultimate fallback: the parameter itself (not localised) --> <xsl:text>]</xsl:text> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- The template for the root element of the status XML --> <xsl:template match="/RMS_status_report"> <html> <head> <title> <xsl:call-template name="getString"> <xsl:with-param name="stringName" select="name()" /> </xsl:call-template> </title> <link rel="stylesheet" type="text/css" href="report-style.css" /> <!-- Using the 'type' attribute requires HTML 4 --> </head> <body> <h1> <xsl:call-template name="getString"> <xsl:with-param name="stringName" select="name()" /> </xsl:call-template> </h1> <!-- more stuff at the beginning --> <table border="0"> <xsl:apply-templates /> </table> <xsl:if test="$origin"> <!-- input type="button" name="Refresh" value="Refresh" onclick="javascript:history.back()"/ --> <xsl:element name="input"> <xsl:attribute name="type">button</xsl:attribute> <xsl:attribute name="name">Refresh</xsl:attribute> <!-- Initial value, displayed as text on the button --> <xsl:attribute name="value"><xsl:call-template name="getString"><xsl:with-param name="stringName" select="'Refresh'" /></xsl:call-template></xsl:attribute> <xsl:attribute name="onclick">javascript:history.back()</xsl:attribute> </xsl:element> </xsl:if> </body> </html> </xsl:template> <!-- Data about the computer --> <xsl:template match="/RMS_status_report/computer_data"> <tr> <th colspan="2"> <p class="section"><!-- The 'class' attribute requires HTML 4 --> <xsl:call-template name="getString"> <xsl:with-param name="stringName" select="name()" /> </xsl:call-template> </p> </th> </tr> <xsl:apply-templates /> </xsl:template> <xsl:template match="/RMS_status_report/computer_data/*[self::GMT or self::local_time]"> <tr> <th> <xsl:call-template name="getString"> <xsl:with-param name="stringName" select="'report_time'" /> </xsl:call-template> (<xsl:call-template name="getString"><xsl:with-param name="stringName" select="name()" /></xsl:call-template>)</th> <td><xsl:value-of select="normalize-space(text())" /></td> </tr> </xsl:template> <xsl:template match="/RMS_status_report/computer_data/*[self::computer_name or self::router_name or self::domain or self::workgroup or self::SSLIOP_port or self::IOR_port or self::parent_addresses or self::actual_parent]"> <tr> <th> <xsl:call-template name="getString"> <xsl:with-param name="stringName" select="name()" /> </xsl:call-template>:</th> <td> <xsl:apply-templates /> </td> </tr> </xsl:template> <!-- This is slightly different from the above; the content also needs to be localised --> <xsl:template match="/RMS_status_report/computer_data/router_type"> <tr> <th> <xsl:call-template name="getString"> <xsl:with-param name="stringName" select="name()" /> </xsl:call-template>:</th> <td> <xsl:call-template name="getString"> <xsl:with-param name="stringName" select="normalize-space(text())" /> </xsl:call-template> </td> </tr> </xsl:template> <!-- Template for one of the four sections --> <xsl:template match="/RMS_status_report/sections/section"> <tr> <th colspan="2"> <p class="section"><!-- The 'class' attribute requires HTML 4 --> <xsl:call-template name="getString"> <xsl:with-param name="stringName" select="@name" /> </xsl:call-template> </p> </th> </tr> <xsl:apply-templates /> </xsl:template> <!-- Elements inside the sections --> <xsl:template match="/RMS_status_report/sections/section/alert/*[self::problem or self::summary or self::cause or self::action]"> <tr> <th> <xsl:call-template name="getString"> <xsl:with-param name="stringName" select="name()" /> </xsl:call-template>:</th> <td> <xsl:if test="name()='problem'"> <!-- Embolden the problem --> <xsl:attribute name="class">strong</xsl:attribute> </xsl:if> <!-- <xsl:value-of select="normalize-space(text())" /> --> <xsl:apply-templates /> </td> </tr> </xsl:template> <!-- A bit more processing needed here --> <xsl:template match="/RMS_status_report/sections/section/alert/more_info"> <tr> <th> <xsl:call-template name="getString"> <xsl:with-param name="stringName" select="name()" /> </xsl:call-template>:</th> <td> <!-- Create a hyperlink. Putting it together piecemeal as a string is not possible, because the HTML tags interfere with XML. --> <a> <!-- Create the href attribute "the XSLT way" --> <xsl:attribute name="href"> <!-- First, the KB URL prefix, like http://www.sophos.com/support/knowledgebase/article/ Localisation is used to select the appropriate website (sophos.de, esp.sophos.com, etc) --> <xsl:call-template name="getString"> <xsl:with-param name="stringName" select="'kburl'" /> </xsl:call-template> <!-- The article number also needs to be "localised" because translations of the same text have different KB article numbes --> <xsl:call-template name="getString"> <xsl:with-param name="stringName" select="normalize-space(text())" /> </xsl:call-template> <!-- Temporarily hidden because milton.sophos.com needs just the article number <xsl:value-of select="'.html'" /> --> </xsl:attribute> <!-- Now the text of the link (fixed) --> <xsl:call-template name="getString"> <xsl:with-param name="stringName" select="'KBarticle'" /> </xsl:call-template> </a> </td> </tr> </xsl:template> <!-- HTML "pass-through" --> <xsl:template match="p"> <p /> </xsl:template> <xsl:template match="br"> <br /> </xsl:template> </xsl:stylesheet> <!-- The end -->