XSLT error: ‘xsl:case’ cannot be a child of ‘xyz’ element

I got this error when doing custom XSLT with a BizTalk map.

It was a case of “brain fog”. The proper keyword is xsl:choose, not xsl:case. Other languages call this a switch or a case. I just temporarily forgot that XSLT calls it a “choose”.

Example of what the xsl:choose looks like (from https://www.w3schools.com/xml/xsl_choose.asp

  <xsl:when test="expression">
    ... some output ...
    ... some output ....


Leave a Reply