...
Example 1: template that just writes event name. notice Xpath EventData/EventInfo/Event
Code Block | ||
---|---|---|
| ||
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <xsl:value-of select="EventData/EventInfo/Event"/> </xsl:template> </xsl:stylesheet> |
Example 2: template that takes something from event data - let’s say we have event UserTermsAndConditionsAccepted and we want to write TargetSystemName
Code Block | ||
---|---|---|
| ||
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <xsl:value-of select="EventData/UserTermsAndConditionsAccepted/TargetSystemName"/> </xsl:template> </xsl:stylesheet> |
...
Example 3: notification in HTML format and with table inside event data (event data contract is MachineLogonUserNotificationDataContract
)
Code Block | ||
---|---|---|
| ||
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <body> <h2>Logon Users of the week</h2> <xsl:value-of select="EventData/EventInfo/EventMessage"/> <h2><xsl <h2> <xsl:value-of select="EventData/MachineLogonUserNotificationDataContract/MachineName"/><> </h2> <table border="1"> <tr bgcolor="#9acd32"> <th>Time</th> <th>Identifier</th> <th>Action</th> </tr> <xsl:for-each select="EventData/MachineLogonUserNotificationDataContract/LogonUsers/LogonUserHeaderDataContractArray/LogonUserHeaderDataContract"> <tr> <td><xsl <td> <xsl:value-of select="TimeStamp" /><> </td> <td><xsl <td> <xsl:value-of select="Identifier" /></td> <td><xsl> </td> <td> <xsl:value-of select="Action" /><> </td> </tr> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet> |
...
EventInfo contains:
Code Block | ||
---|---|---|
| ||
{ EventMessage : string Event : string, //translated event name Level : string //translated event level } |
...