Skip to content

Log.XSL

Save this stylesheet as \MaData\log.xsl. Then use the ArchiveLog script to copy your export.xml and import.xml files to datestamped versions, as soon as they are created. You should then be able to view your log files in a browser.

 

NOTE: WordPress is doing something bizarre with the double and single quotes. You will probably need to tidy them up.

 

<?xml version=”1.0″ encoding=”ISO-8859-1″?>
<xsl:stylesheet version=”1.0″
xmlns:xsl=”http://www.w3.org/1999/XSL/Transform”>
<xsl:template match=”/”>
  <html>
  <body>
    <h2><xsl:value-of select=”top/xmlfile-time” /></h2>
    <table border=”1″>
      <tr bgcolor=”#0066FF”>
        <th>Operation</th>
        <th>DN</th>
        <th>Attributes</th>
      </tr>
      <xsl:for-each select=”top/delta”>

<!– Start a Row –>
      <tr>
    
  <!– Operation and DN Columns –>
         <xsl:choose>
         <xsl:when test = “@newdn”>
           <td><font size=”2″>rename</font></td>
           <td><font size=”2″><xsl:value-of select=”@dn” /><br></br><xsl:value-of select=”@newdn” /></font></td>
         </xsl:when>
         <xsl:otherwise>
           <td><font size=”2″><xsl:value-of select=”@operation” /></font></td>
           <td><font size=”2″><xsl:value-of select=”@dn” /></font></td>
         </xsl:otherwise>
        </xsl:choose>
       
  <!– Attributes Column –>
        <td>
        <table border=”0″>

        <!– DN attributes –>
        <xsl:for-each select=”dn-attr”>
        <tr>
     

          <!– Multi-valued –>
         <xsl:if test = “@multivalued=’true’”>
            <xsl:choose>
            <xsl:when test = “attr/@operation=’add’”>
              <td bgcolor=”#CCFFCC”><font size=”2″><xsl:value-of select=”@name” /> add</font></td>
            </xsl:when>
            <xsl:when test = “attr/@operation=’delete’”>
              <td bgcolor=”#CC6666″><font size=”2″><xsl:value-of select=”@name” /> delete</font></td>
            </xsl:when>
            <xsl:otherwise>
              <td bgcolor=”#CCCCFF”><font size=”2″><xsl:value-of select=”@name” /></font></td>
            </xsl:otherwise>
            </xsl:choose>

            <td>
              <xsl:for-each select=”dn-value”>
                <table border=”0″>
                  <xsl:choose>
                  <xsl:when test = “@operation=’delete’”>
                    <tr><td><font size=”2″>delete: <xsl:value-of select=”dn” /></font></td></tr>
                  </xsl:when>
                  <xsl:when test = “@operation=’add’”>
                    <tr><td><font size=”2″>add: <xsl:value-of select=”dn” /></font></td></tr>
                  </xsl:when>
                  <xsl:otherwise>
                    <tr><td><font size=”2″><xsl:value-of select=”dn” /></font></td></tr>
                  </xsl:otherwise>
                  </xsl:choose>
                </table>
              </xsl:for-each>
            </td>
          </xsl:if>
         

          <!– Single-valued –>
           <xsl:if test = “@multivalued=’false’”>
             <td bgcolor=”#CCCCFF”><font size=”2″><xsl:value-of select=”@name” /></font></td>
             <td><font size=”2″><xsl:value-of select=”dn-value/dn” /></font></td>
           </xsl:if>

          
        </tr>      
        </xsl:for-each>

        
        <!– Ordinary attributes –>
        <xsl:for-each select=”attr”>
        <tr>

          <!– Multi-value –>
          <xsl:if test = “@multivalued=’true’”>
            <xsl:choose>
            <xsl:when test = “attr/@operation=’add’”>
              <td bgcolor=”#CCFFCC”><font size=”2″><xsl:value-of select=”@name” /> add</font></td>
            </xsl:when>
            <xsl:when test = “attr/@operation=’delete’”>
              <td bgcolor=”#CC6666″><font size=”2″><xsl:value-of select=”@name” /> delete</font></td>
            </xsl:when>
            <xsl:otherwise>
              <td bgcolor=”#CCCCFF”><font size=”2″><xsl:value-of select=”@name” /></font></td>
            </xsl:otherwise>
            </xsl:choose>

            <td>
              <xsl:for-each select=”value”>
                <table border=”0″>
                  <xsl:choose>
                  <xsl:when test = “@operation=’delete’”>
                    <tr><td><font size=”2″>delete: <xsl:value-of select=”.” /></font></td></tr>
                  </xsl:when>
                  <xsl:when test = “@operation=’add’”>
                    <tr><td><font size=”2″>add: <xsl:value-of select=”.” /></font></td></tr>
                  </xsl:when>
                  <xsl:otherwise>
                    <tr><td><font size=”2″><xsl:value-of select=”.” /></font></td></tr>
                  </xsl:otherwise>
                  </xsl:choose>
                </table>
              </xsl:for-each>
            </td>
          </xsl:if>
         

          <!– Single-valued –>
          <xsl:if test = “@multivalued=’false’”>
            <xsl:if test = “@name!=’unicodePwd’”>
            <xsl:if test = “@name!=’msExchMailboxSecurityDescriptor’”>
              <td bgcolor=”#CCCCFF”><font size=”2″><xsl:value-of select=”@name” /></font></td>
              <td><font size=”2″><xsl:value-of select=”value” /></font></td>
            </xsl:if>
            </xsl:if>
          </xsl:if>
        
        </tr>
        </xsl:for-each>

        </table>
        </td>
      </tr>
      </xsl:for-each>
    </table>
  </body>
  </html>

</xsl:template>

</xsl:stylesheet>