Getting XSLEvaluationFailed when Passing XML as param in XSLT Transform policy

Not applicable

As per my requirement, I need to pass two xml payloads in xsl transform policy, to address this am passing one xmls as <Source> and other one as param as below


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<XSL async="false" continueOnError="false" enabled="true" name="XSLTTransformMultipleXMLs">
	<DisplayName>XSLTTransformMultipleXMLs</DisplayName>
	<Properties/>
	<Source>xmlPayload_1</Source>
	<ResourceURL>xsl://XSLTTransformMultipleXMLs.xsl</ResourceURL>
	<Parameters ignoreUnresolvedVariables="true">
		<Parameter name="xmlPayload_2" ref="xmlPayload_2"/>
	</Parameters>
</XSL>

Edge is returning below error where as same works in xmlspy.. could you please suggest if I have missed something..

"Required item type of first operand of '\\\/' is node(); supplied value has item type xs:untypedAtomic\+ XSLT"

Please find attached xslt with multiple xmls. attachments.zip

0 2 736
2 REPLIES 2

@PRASANTH

See similar question asked here. Keep us posted if any.

I know PRASANTH asked this question more than a year ago. I had missed it then, but I'm answering it now in case someone else has a similar question.

You should use saxon:parse() to instantiate an XML doc within the XSL, from the input parameter. With your policy config, the XSL looks like this:

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:saxon="http://saxon.sf.net/"
                exclude-result-prefixes="saxon fhir" >
  <xsl:output indent="yes"/>
  <xsl:strip-space elements="*"/>
  <xsl:param name="xmlPayload_2" select="''"/>
  <xsl:variable name="xmldoc" select="saxon:parse($xmlPayload_2)"/>
  <xsl:template match="/">
    <Output>
      <xsl:copy-of select="$xmldoc/Root/element"/>
    </Output>
  </xsl:template>
</xsl:stylesheet>