Test XSLT mappings before deploying to IFS Connect
Documentation-based guide draft · Reviewed against sources on 2026-09-27 · Not executed in an IFS environment. IFS references use 26R1 unless stated otherwise. Confirm available APIs, components, and permissions in your installed release.
Reproduce an XML mapping locally before uploading it to IFS Connect. You will transform a fictional equipment reading, inspect the result, and deliberately fail a missing-field case. Use XSLT 1.0 constructs for this exercise; do not assume a newer desktop engine matches the IFS runtime.
Before you start
Section titled “Before you start”Create a local test folder and use PowerShell with .NET’s XML classes. Use fictional input only. The example mapping is an original teaching contract, not the schema of an installed IFS business interface.
1. Save a small input fixture
Section titled “1. Save a small input fixture”Save reading.xml:
<reading xmlns="urn:howtoifs:lab" id="LAB-029"> <equipment>PUMP-3</equipment> <value unit="C">18.5</value></reading>The namespace is intentional. An XPath using /reading/equipment without a namespace binding will not select these elements.
2. Write the mapping
Section titled “2. Write the mapping”Save reading.xsl:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:r="urn:howtoifs:lab" exclude-result-prefixes="r"> <xsl:output method="xml" encoding="UTF-8" indent="yes"/> <xsl:template match="/"> <xsl:if test="not(r:reading/@id) or normalize-space(r:reading/r:equipment) = ''"> <xsl:message terminate="yes">Reading ID and equipment are required</xsl:message> </xsl:if> <measurement> <reference><xsl:value-of select="r:reading/@id"/></reference> <asset><xsl:value-of select="r:reading/r:equipment"/></asset> <amount unit="{r:reading/r:value/@unit}"> <xsl:value-of select="r:reading/r:value"/> </amount> </measurement> </xsl:template></xsl:stylesheet>xsl:value-of writes text through the XML serializer, so an equipment value containing an ampersand is escaped correctly. Do not build XML output through concatenated strings.
3. Run with external-resource access disabled
Section titled “3. Run with external-resource access disabled”Save run-mapping.ps1 in the same folder:
$ErrorActionPreference = 'Stop'$xmlSettings = [System.Xml.XmlReaderSettings]::new()$xmlSettings.DtdProcessing = [System.Xml.DtdProcessing]::Prohibit$xmlSettings.XmlResolver = $null$xsltSettings = [System.Xml.Xsl.XsltSettings]::new($false, $false)$transform = [System.Xml.Xsl.XslCompiledTransform]::new()$styleReader = [System.Xml.XmlReader]::Create((Join-Path $PSScriptRoot 'reading.xsl'), $xmlSettings)try { $transform.Load($styleReader, $xsltSettings, $null) }finally { $styleReader.Dispose() }$inputReader = [System.Xml.XmlReader]::Create((Join-Path $PSScriptRoot 'reading.xml'), $xmlSettings)$outputWriter = [System.Xml.XmlWriter]::Create((Join-Path $PSScriptRoot 'result.xml'), $transform.OutputSettings)try { $transform.Transform($inputReader, $null, $outputWriter) }finally { $inputReader.Dispose(); $outputWriter.Dispose() }Run ./run-mapping.ps1. Inspect result.xml: it should contain reference LAB-029, asset PUMP-3, and amount 18.5 with unit C. Local output proves the fixture mapping, not compatibility with every IFS transformer engine.
4. Test the failure modes
Section titled “4. Test the failure modes”Make one change at a time and restore the valid fixture between runs:
| Change | Expected result |
|---|---|
| Empty equipment element | Transformation fails with the required-fields message |
| Wrong namespace URI | Required-fields check fails; no silently empty business message |
Equipment text A & B |
Output preserves A & B as XML text |
| Malformed XML | XML parser rejects the input |
| Add a DTD | Local reader rejects it |
Validate the result against the real destination XSD when adapting this example. A well-formed result can still violate required field types or element ordering.
5. Upload the same tested stylesheet
Section titled “5. Upload the same tested stylesheet”Open Setup IFS Connect, create an XslTransformer, and upload the tested .xsl as TRANSFORMER_FILE. Associate it with the intended development routing address. Submit the exact same fixture and compare its transformed business fields with result.xml.
If local output works but IFS fails, check runtime XSLT support, namespaces, stylesheet version, and the actual message envelope arriving at the transformer. Save a sanitized runtime input instead of testing only your original file.
Keep the previous stylesheet and routing association for rollback. Disable test traffic before restoring them. Remove temporary fixture/output files after retaining only the evidence required for your review.
See IFS transformer configuration for upload fields.
Sources and scope
Section titled “Sources and scope”Older IFS Applications examples are historical context, not evidence of Cloud compatibility. No third-party code, screenshots, or downloadable workflows are reproduced.