DEV Community

sphurthi Edara
sphurthi Edara

Posted on

Fixing XSLT Import Issues in MuleSoft (Works in Local but Fails in RTF Runtime)

Fixing XSLT Import Issues in MuleSoft
(Works in Local but Fails in RTF Runtime)

Introduction
XSLT (Extensible Stylesheet Language Transformations) is used to transform XML data from one format into another during application integrations.
While working on a MuleSoft integration project, I faced a challenging issue where the XSLT transformation worked perfectly in Anypoint Studio (local environment) but failed after deployment to Runtime Fabric (RTF).
After trying multiple approaches and finding very limited documentation for this issue, I was able to identify the root cause and implement a working solution. In this article, I will explain the issue, failed approaches, and the final solution that resolved it successfully.


πŸ”Ή Scenario
I had:
β€’ A parent XSLT file
β€’ One or more child XSL files
β€’ Requirement: Import child XSL inside the parent and perform transformation

πŸ”Ή Local Setup vs Runtime Issue
β€’ Both the parent and child XSL files were stored under:
src/main/resources/xslt/

In the General section, I used:
β€’ Content β†’ Passed the payload to be transformed
β€’ XSLT β†’ Referenced the parent XSL file using:
${file::xslt/parent.xsl}

β€’ Inside the parent XSL, I imported the child XSL using:

πŸ“Έ (Refer to the screenshot above for the exact configuration)

πŸ‘‰ With this setup, the transformation worked perfectly in the local environment (Anypoint Studio).

πŸ”΄ Issue in Runtime Fabric (RTF)

However, when the same application was deployed to the RTF (Runtime Fabric) environment, the transformation failed with the following error:

[2026-04-21 17:50:36.966] ERROR DefaultExceptionListener [[MuleRuntime].uber.03: [test].test.CPU_INTENSIVE @65f712f4] [event: ]:


Message : I/O error reported by XML parser processing file:/apps/test/xslt/xsl/child.xsl: /apps/test/xslt/xsl/child.xsl (No such file or directory)

πŸ’‘ Why This Happens

In Anypoint Studio (local):
β€’ Mule can resolve ${file::} paths directly from the filesystem

In RTF (runtime):
β€’ Resources are packaged inside the application JAR
β€’ Mule uses classpath-based resolution, not filesystem paths

πŸ‘‰ That’s why the child XSL cannot be found in runtime

πŸ”΄ Failed Approaches
I tried multiple approaches, but none worked:

  1. Using classpath inside parent XSL

    ❌ Error:


    Message : I/O error reported by XML parser processing classpath:/xslt.xsl/child.xsl: unknown protocol: classpath

  2. Using relative path

    ❌ Error:


    Message : I/O error reported by XML parser processing file:/tmp/child.xsl: /tmp/child.xsl (No such file or directory)

  3. Using absolute path

    *Both child and parent xsl are in same xslt folder unser src/main/resoucrces.
    ❌ Error:


    Message : I/O error reported by XML parser processing file:/xslt/child.xsl: /xslt/child.xsl (No such file or directory)

βœ… Final Working Solution
The solution was a combination of correct XSLT reference + classpath usage + dependency alignment.
βœ” Step 1: Change how parent XSL is referenced
Instead of using ${file::...}, declare XSL directly in the XSLT component:
xml-module:xslt
<![CDATA[]]>
/xml-module:xslt

βœ” Step 2: Use classpath inside parent XSL

πŸ‘‰ This ensures Mule runtime correctly resolves resources from the classpath.

βœ” Step 3: Ensure correct folder structure
src/main/resources/xslt/
└── child.xsl

βœ” Step 4: Match Mule XML Module dependency with runtime

org.mule.modules
mule-xml-module
1.4.3
mule-plugin

πŸ‘‰ Important: Dependency version must align with your Mule runtime.
β€’ Runtime used: 4.10.2
β€’ Module version: 1.4.3

πŸ’‘ Bonus Insight
This solution also works when:
β€’ You have multiple child XSL files
β€’ Complex transformations with nested imports
I tested this with multiple child XSLs, and it worked consistently in both:
β€’ Local (Studio)
β€’ RTF Runtime

πŸ”Ή Conclusion
This issue is not well documented, and it can be frustrating when something works locally but fails in runtime.
β€’ By correctly using classpath-based imports and aligning dependencies, you can ensure consistent XSLT execution across environments.
β€’ I hope this helps anyone facing similar issues and saves valuable debugging time.

✍️ Author
Sphurthi Edara
MuleSoft Developer
Connect with me on LinkedIn:
https://www.linkedin.com/in/sphurthi-edara/

Top comments (0)