BizTalk XSLT Reuse (xsl:include and xsl:import): Resolving of external URIs was prohibited error

A client of mine, use a strategy for re-use XSL, basically, they have custom XSLT with external XSLT’s that contain global functions that can be used inside all XSLT transformations.

When I tried to import this strategy to BizTalk mapper, the aim was to migrate old flows to BizTalk orchestrations, the map fails with the error:

“XSL transform error: (0,0) : Resolving of External URI’s was prohibited. “

Cause

  • This issue can occur if the XSLT file that is defined in the Custom XSL Path Grid Properties uses the <xsl:import> element or the <xsl:include> element to import or to include an external XSLT file.

More Information

The <xsl:import> element is used to import an external XSLT file. The <xsl:include> element is used to include an external XSLT file. You cannot use these elements in custom XSLT files that are defined in the Custom XSL Path Grid Properties in a BizTalk project. You cannot do this because a Uniform Resource Identifier (URI) that is defined in an external XSLT file may be from a nonsecure source such as the Internet.

Solution

  • To work around this issue, make sure that the XSLT file that is defined in the Custom XSL Path Grid Properties contains all the code that is required to transform the message.

This is a valid solution, however, it loses the re-use functionality, because you have to do this for all the XSLTs.

Another Solution with reuse Functionality

  • Do the transformation by C# code:
    • Inside a Message Assignment Shape
    • Or by creating an XslTransformPipelineComponent which provides an appropriate XmlResolver.
Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc. He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.

3 thoughts on “BizTalk XSLT Reuse (xsl:include and xsl:import): Resolving of external URIs was prohibited error”

  1. Regarding the first solution, it would be nice if you mentioned how to combine two existing xslt-files into one

Leave a Reply

Your email address will not be published. Required fields are marked *

BizTalk360
BizTalk Server

Over 500+ customers across
30+ countries depend on BizTalk360

Learn More
Serverless360
Azure

Manage and monitor serverless
components effortlessly

Learn More
Atomicscope
Business Users

Monitor your Business Activity in iPaaS
or Hybrid integration solutions

Learn More

Back to Top