ERROR #6901: XSLT XML Transformer Error: SAXParseException: invalid character 0x1C (Occurred in an unknown entity)

The same piece of data never throws this error on other operations. I am getting this error on one always .

The same SDA container never throws error on other operation.

ERROR #6901: XSLT XML Transformer Error: SAXParseException: invalid character 0x1C (Occurred in an unknown entity)


Set xslt=##class(%Dictionary.XDataDefinition).%OpenId(..%ClassName(1)_"||Xmethod",-1,.tStatus)
$$$ThrowOnError(tStatus)
Set tStatus= ##class(%XML.XSLT.Transformer).TransformStream(myStream,xslt.Data,.OpStream)
$$$ThrowOnError(tStatus)

XData Xmethod
{

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <xsl:output omit-xml-declaration="yes" indent="yes"/>
  <xsl:template match="/Container">
    <xsl:apply-templates select="Encounters" mode="mytemplate">
    </xsl:apply-templates>
  </xsl:template>
  <xsl:template match="*" mode="mytemplate">
    <xsl:variable name='myvar'>
      <xsl:choose>
        <xsl:when test="/Container/Encounters/Encounter/SeparationMode[Description='100']">
          <xsl:value-of select="1"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="0"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:variable>
    <xsl:copy-of select="$myvar"/>
  </xsl:template>
</xsl:stylesheet>

}

  • 0
  • 0
  • 184
  • 0
  • 1

Answers

Try this:

1. Write stream to string

2. Use $zcvt on string $zcvt(string,"O","UTF8")

3. Send this stream to XSLT