Remove Empty Nodes XSL

Added here for my own personal cut ‘n’ paste reuse. Drop all empty nodes from an outbound message. Compile the attached into a BizTalk map using the custom XSLT override BizTalk mapper functionality and then call with the streaming transform pipeline component here. The send port order of operation means you outbound maps on your send port will be executed before the pipeline.

<?xml version="1.0" encoding="UTF-16"?>
<xsl:stylesheet xmlns:xsl="" version="1.0" xmlns:ns0="">
  <xsl:output method="xml" indent="yes" />
  <xsl:template match="node()">
    <xsl:if test="count(descendant::text()[string-length(normalize-space(.))>0]|@*)">
        <xsl:apply-templates select="@*|node()" />
  <xsl:template match="@*">
    <xsl:copy />
  <xsl:template match="text()">
    <xsl:value-of select="normalize-space(.)" />
This entry was posted in BizTalk Server. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s