Skip to content
Documentation
Updated 7 minutes to read
Markdown

Transform Log Event XML into cleansed, business-friendly formats for end-user viewing in Log Views, using an XSLT Stylesheet.

Install the XML to XML example as an XSLT Stylesheet and strip the SOAP envelope from an order status in a Log View, animated walkthrough (7.12)
Animated walkthrough: Add Stylesheet, Type XSLT, paste the example, bind the Message Type, and Save and close. In the Log View, View message body shows the SOAP envelope; View message formatted as the Stylesheet shows only <Orders>, without the envelope or its prefixes.

Most stylesheets transform XML to HTML for visual presentation in Log Views. But there are compelling business reasons to keep the output as XML:

  • Remove sensitive data - Strip PII (Personally Identifiable Information), credentials, or confidential business data before displaying to end users in Log Views
  • Meet compliance requirements - GDPR, HIPAA, PCI-DSS often prohibit showing certain fields to operations teams or auditors
  • Audit trail safety - Log Views are accessible to multiple users; cleansed XML reduces exposure risk
  • Strip technical noise - Remove verbose SOAP envelopes, namespaces, or wrapper elements to show only the business payload
  • Simplify structure - Transform complex nested XML into flat, readable format for operations teams who aren't XML experts
  • Focus on business data - End users see just the order details, customer information, or transaction data—not SOAP protocol overhead
  • Enable copy-paste - Users can copy the cleansed XML from Log Views and paste into other tools, testing systems, or support tickets
  • Support downstream analysis - Analysts can export and parse clean XML for reporting or data investigation
  • Standardize formats - Convert various message formats into a consistent structure for easier troubleshooting
  1. Strip SOAP envelope - Remove web service wrappers to expose just the business message in Log Views
  2. Mask customer data - Replace credit card numbers, SSNs, or emails with *** before displaying in Log Views
  3. Remove credentials - Strip username/password fields from authentication messages visible to support staff
  4. Simplify structure - Transform complex nested XML into flat format for operations teams viewing Log Events

This example demonstrates the most common XML-to-XML transformation: extracting the business payload from a SOAP web service envelope for display in Log Views.

graph LR A["fa:fa-envelope SOAP Envelope
with Business Payload"] --> B["fa:fa-magic XSLT
Transformation"] B --> C["fa:fa-file-code Clean Business
XML Only"] style A fill:#FFD525,color:#000 style B fill:#2678BD,color:#fff style C fill:#93d16d,color:#000

XSLT transformation flow: the SOAP envelope (yellow, protocol noise) passes the XSLT step (blue) and leaves clean business XML (green) for Log Views.

  • Removes the outer SOAP <Envelope> wrapper
  • Extracts content from <Body> element
  • Strips all namespace prefixes (soap:, soapenv:)
  • Preserves the business message structure and data
  • Operations teams viewing Log Events need to see just the business data, not SOAP protocol overhead
  • End users aren't familiar with SOAP structure and find envelopes confusing
  • You want cleaner, more readable Log Views focused on business content

The stylesheet uses XSLT templates to navigate the SOAP structure and extract only the business content:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" exclude-result-prefixes="soap">
<xsl:output method="xml" omit-xml-declaration="yes" version="1.0" encoding="UTF-8" indent ="yes"/>
<xsl:template match="/">
<xsl:apply-templates select="soapenv:Envelope/soapenv:Body/*"/>
</xsl:template>
<xsl:template match="*">
<xsl:element name="{local-name()}">
<xsl:apply-templates select="@*|node()"/>
</xsl:element>
</xsl:template>
<xsl:template match="@*">
<xsl:attribute name="{local-name()}">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:template>
</xsl:stylesheet>
  1. Root template (match="/") - Selects only the content inside <Body>, ignoring the <Envelope> wrapper
  2. Element template (match="*") - Recreates each element using local-name() to strip namespace prefixes
  3. Attribute template (match="@*") - Preserves all attributes while removing namespace prefixes
  4. Output formatting - Indents the result for readability with indent="yes"

A typical SOAP message with envelope wrapper and business payload:

<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
<soap:Body>
<Orders>
<Order state="OK">
<Id>1337</Id>
</Order>
</Orders>
</soap:Body>
</soap:Envelope>
  • <soap:Envelope> wrapper - Protocol overhead, not business data
  • <soap:Body> container - Holds the actual business message
  • <Orders> element - The business payload operations teams care about

After applying the XSLT transformation, only the clean business payload remains:

<Orders>
<Order state="OK">
<Id>1337</Id>
</Order>
</Orders>
  • SOAP envelope completely removed
  • Namespace prefixes stripped
  • Business message preserved exactly
  • Clean, readable XML for operations teams viewing Log Events

Beyond stripping envelopes, you can mask or remove sensitive fields for compliance and security before displaying in Log Views.

graph TD A["fa:fa-file-code Original XML
with PII"] --> B{"fa:fa-shield-halved XSLT
Data Masking"} B --> C["fa:fa-credit-card Credit Card
****-****-****-****"] B --> D["fa:fa-id-card SSN
***-**-****"] B --> E["fa:fa-key Passwords
(removed)"] C --> F["fa:fa-check-circle Compliant XML
for Log Views"] D --> F E --> F style A fill:#FFD525,color:#000 style B fill:#2678BD,color:#fff style C fill:#93d16d,color:#000 style D fill:#93d16d,color:#000 style E fill:#93d16d,color:#000 style F fill:#93d16d,color:#000

XSLT data masking flow: original XML with personal data (yellow, at risk) passes the masking step (blue) and leaves masked, compliant output (green) for display in Log Views under GDPR, HIPAA, or PCI-DSS.

<!-- Add to your stylesheet templates -->
<xsl:template match="CreditCardNumber">
<CreditCardNumber>****-****-****-****</CreditCardNumber>
</xsl:template>
<xsl:template match="SSN">
<SSN>***-**-****</SSN>
</xsl:template>
<!-- Completely remove password fields -->
<xsl:template match="Password"/>
<xsl:template match="ApiKey"/>
  • Compliance - Meet GDPR, HIPAA, PCI-DSS requirements by not displaying sensitive data in Log Views accessible to multiple users
  • Security - Log Views may be viewed by support staff, auditors, or operations teams who shouldn't see customer PII
  • Access control - Operations teams can troubleshoot messages without seeing customer confidential data
  1. Create a new Stylesheet in Nodinite (see Add or manage Stylesheet)
  2. Paste the XSLT code and customize for your XML structure
  3. Test the transformation against a logged Log Event: click Message Body, choose Message Id, and click Preview (see Preview with a test message body)
  4. Associate the stylesheet with the Message Types of the Log Events; every Log View that shows those events can then use it
  5. Click Save
  6. In a Log View, open the Action menu of a matching Log Event and choose View message formatted as the Stylesheet
  • XML will display in Log Views as plain text or formatted XML depending on browser capabilities
  • Most modern browsers provide collapsible XML tree views for better readability
  • Users can copy-paste the XML output for use in other tools
  • XSLT transformations run when users view Log Events in Log Views
  • For Log Views with thousands of events, keep transformations simple and efficient
  • Complex XPath expressions or recursive templates may slow down Log View rendering
  • Test your transformation with various message samples to ensure proper handling of edge cases
  • Verify that masked/removed fields don't break XML structure
  • Ensure output is well-formed XML that browsers can display correctly

Alarm Plugin Object - Transform alarm object XML with XSLT for emails
XML Passthrough - Debug stylesheet for raw XML output in emails
Stylesheets - Understanding stylesheet types and capabilities
Base64Decode XML from JSON - Another XML transformation example
Stylesheet Examples - All XSLT and Liquid examples
Log Views - Where the transformed XML is shown
Message Types - Decide which Stylesheet formats a Log Event

...

Version:
Release date: N/A
Loading...

Explore Nodinite for 30 days – completely free

  • Find out why this is the leading O&M software
  • Prove your business case
  • Test the self-service for the business side

Loading...

See how Nodinite resolves your technical issues, in a LIVE Demo!

Once you submit this request:

  • We will give you a short call to understand the issues you want to tackle.
  • Understand solutions you have tried and why were you not happy with them.
  • Book a convenient slot for a LIVE demo!

Loading...