Be.Stateless.BizTalk.Xml
Build Pipelines
Latest Release
Release Preview
Overview
Be.Stateless.BizTalk.Xml
is part of the BizTalk.Factory Runtime Package. This component essentially is an XML
class library for general purpose Microsoft BizTalk Server® development.
Compiled XSLT
Transforms on Steroids
Since its inception in the days of Microsoft BizTalk Server® 2009, BizTalk.Factory
has always supported and encouraged the use of compiled XSLT
transforms for obvious reasons. Even though Microsoft BizTalk Server® 2010 finally did the shift too, BizTalk.Factory
kept its own XslCompiledTransform
-wrapping API
due the following two unique features:
-
An
XSLT
stylesheet can combine multipleXSLT
stylesheets viaxsl:import
orxsl:include
top-level elements, see the dummy CompoundMapTransform for an example, or XslMapUrlResolver for some background information; -
An
XSLT
stylesheet that is executing in a pipeline can require access to the context of the message by simply declaring the distinguishedXML
namespace of the MessageContext pseudo extension object, see the dummy CompoundContextMapTransform for an example, or XslCompiledTransformDescriptor, XslCompiledTransformDescriptorBuilder, and Transformer for some background information.
Back in those days, even though it was made of a bunch of distinct assemblies, BizTalk.Factory
1.0 was both a giant monolithic repository and deployment package. With the advent of BizTalk.Factory
2.0, the monolith has been split into a bunch of repositories, individual deployment packages, and PowerShell
modules — nearly 40 GitHub
repositories, 4 deployment packages, 6 PowerShell
modules, and nearly 60 NuGet
packages. This is only relevant insofar as it is to be understood that currently the XslCompiledTransform
-wrapping API
, though rooted in Be.Stateless.BizTalk.Xml
, is also spread across the following other repositories and NuGet
packages:
-
Be.Stateless.BizTalk.Stream
, which sits on top ofBe.Stateless.BizTalk.Xml
to deliver all these features through a streamingAPI
, see Transformer; -
Be.Stateless.BizTalk.Pipeline.MicroComponents
, whoseXsltRunner
component consumes the latter streamingAPI
; -
Be.Stateless.BizTalk.XLang
, whose TransformHelper ensures that compositeXSLT
stylesheets are supported while the MessageContext pseudo extension object is not; -
Be.Stateless.BizTalk.Transforms
, and specifically theBe.Stateless.BizTalk.Transform.Unit
NuGet
package, which provides extendedXSLT
stylesheet debugging support, see Debugging Composite Microsoft BizTalk Server® Maps with Extension Objects.
Accessing Message Context through XSLT
Accessing the context of the current message through XSLT
requires that a different MessageContext pseudo extension object be injected into the XSLT
with each message. And that is why the MessageContext is a pseudo extension object, because it is a mediator between the XSLT
and the actual context of the message being transformed. Injecting the right pseudo extension object is the responsibility of the Transformer class.
As the dummy CompoundContextMapTransform illustrates, reading properties from the context of a message can be written in XSLT
as simply as ctx:Read('bf:EnvironmentTag')
where ctx
and Read
denote the pseudo extension object and its operation, and bf
and EnvironmentTag
the property schema —whose namespace has to be declared by the XSLT
— and the property to get access to.
Developer Help
Detailed developer help has been provided as XML
comments directly embedded in source code. Though developers usually browse through this documentation while developing thanks to, for instance, JetBrains ReSharper quick help —ctrl+shift+F1, an online version of this inlined help has also been provided here for greater reachability: