platformnotsupportedException :XSLCompiledTransform.Load(xslt) 未在 .net Core 2.1 目标框架中加载带有 </msxsl:script> 的 xslt 文件

Dee*_*ali 4 .net xml xslt-1.0 .net-core-2.1

我有一个 xml 文件,需要将其转换为 txt,为此我使用了 xslt 转换。我的 xslt 转换文件包含一些支持 javascript 函数

如果我在 .net Framework 4.5 及更高版本中运行代码,我可以成功转换文件,但相同的代码在 .net core 2.1 中会失败。

.netcore 2.1 的文档显示了对 xslt 转换的支持,但它对我不起作用,这是我所缺少的。

我的输入 XML:

   <?xml version="1.0" encoding="utf-8"?>
<Maps xmlns:xsi= "https://www.w3.org/TR/xmlschema-1/" xmlns:xsd= "http://www.w3.org/2001/XMLSchema" xmlns= "http://www.semi.org">
<Map SubstrateId= "EMAXA191X0121" SubstrateType= "">
<Device MachineID= "M/C Name : AOI-404" BinType= "Decimal" NullBin= "099" Orientation= "0" OriginLocation= "2" Columns= "59" Rows= "41" CreateDate= "20190111.214309" ProductId= "EMAXA191X0121" LotId= "" WaferSize= "200">
<ReferenceDevice ReferenceDeviceX= "-1" ReferenceDeviceY= "-1" />
<Bin>
<Bin BinCode= "001" BinCount= "1565" BinQuality= "Pass" />
<Bin BinCode= "061" BinCount= "657" BinQuality= "Fail" />
<Bin BinCode= "062" BinCount= "11" BinQuality= "Fail" />
<Bin BinCode= "064" BinCount= "9" BinQuality= "Fail" />
<Bin BinCode= "065" BinCount= "1" BinQuality= "Fail" />
<Bin BinCode= "069" BinCount= "143" BinQuality= "Fail" />
</Bin>
<Data MapName= "MMI G85" Version= "1.0">
<Row> <![CDATA[061 001 061 061 001 061 061 001 061 061 001 061 061 069 061 061 001 061 061 061 061 061 061 001 061 001 061 061 099 099 099 001 001 061 001 061 061 001 001 001 001 001 061 001 001 001 001 001 061 001 061 001 001 061 061 001 061 061 061]]> </Row>
<Row> <![CDATA[061 001 061 061 001 061 001 001 061 061 061 061 061 001 061 061 061 061 061 061 061 061 061 061 061 061 061 061 001 061 061 061 061 001 061 069 001 001 001 001 001 061 061 001 001 001 001 001 061 001 001 061 001 001 061 061 061 061 061]]> </Row>
<Row> <![CDATA[069 001 001 001 001 001 001 001 001 061 001 001 001 001 001 061 061 061 061 061 061 061 061 061 061 061 061 061 061 061 061 001 061 061 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 061 061 061]]> </Row>
<Row> <![CDATA[069 001 001 001 001 001 001 001 001 001 001 061 001 061 061 061 061 061 061 061 061 061 061 061 061 061 061 061 061 061 061 001 061 069 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 061 061 061]]> </Row>
<Row> <![CDATA[069 001 001 001 001 001 069 001 001 001 001 001 001 001 001 001 001 001 061 061 061 061 061 061 061 061 061 061 061 061 061 061 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 061 001 001 001 061 001 061 001 069 061 061 061]]> </Row>
<Row> <![CDATA[069 001 001 001 001 001 069 061 061 061 061 061 061 061 061 001 061 061 061 061 061 061 061 061 061 061 061 061 061 061 061 061 061 001 001 061 001 001 001 001 001 001 001 001 001 001 061 061 061 001 001 001 001 001 001 061 061 061 061]]> </Row>
<Row> <![CDATA[069 001 001 001 001 001 001 061 001 001 001 001 061 001 061 061 061 061 061 061 061 061 061 061 061 061 061 061 061 061 061 001 061 061 001 061 061 001 001 069 001 061 061 061 001 061 069 001 061 001 061 061 001 001 061 001 061 061 061]]> </Row>
<Row> <![CDATA[069 001 061 001 001 001 001 061 001 001 001 001 001 001 001 061 061 061 061 001 061 061 001 001 001 001 001 001 001 069 001 001 001 069 001 069 001 001 001 001 001 069 001 069 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001]]> </Row>
<Row> <![CDATA[069 001 001 001 001 001 001 001 001 001 001 001 001 001 061 001 061 061 061 061 061 061 061 061 061 061 061 061 061 061 061 001 061 061 001 061 001 061 061 001 061 001 069 001 061 001 001 061 061 001 061 001 001 001 001 001 061 061 061]]> </Row>
<Row> <![CDATA[061 061 001 061 001 001 061 001 001 061 001 001 001 001 061 001 001 061 061 061 061 061 061 061 061 061 061 061 061 061 061 001 061 061 001 061 069 001 001 001 001 001 001 069 061 061 001 061 061 001 001 061 001 001 001 061 061 061 001]]> </Row>
<Row> <![CDATA[069 001 001 001 001 061 001 001 061 001 001 001 061 061 061 001 061 061 061 061 061 061 061 061 061 061 061 061 061 061 061 001 061 061 001 061 001 001 001 001 061 001 061 001 069 001 061 001 061 001 001 001 001 061 001 001 001 001 061]]> </Row>
<Row> <![CDATA[069 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 069 001 001 001 001 001 001 001 001 001 001 069 001 001 001 069 001 001 001 001 001 001 069 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 061 061 061]]> </Row>
<Row> <![CDATA[069 001 001 001 001 001 001 001 001 069 001 001 001 001 001 001 001 061 061 061 061 001 061 061 001 061 061 061 001 061 001 001 061 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 061 001 001 001 001 001 001 001 001 061]]> </Row>
<Row> <![CDATA[069 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 061 061 001 061 061 061 061 061 061 061 061 001 061 061 061 061 061 001 001 001 001 001 061 001 061 001 001 001 061 061 001 001 061 001 001 061 001 001 001 001 061 061]]> </Row>
<Row> <![CDATA[069 001 001 001 001 001 061 001 001 001 001 061 001 001 001 001 001 001 069 001 001 001 001 001 001 001 001 001 069 001 069 001 001 001 001 001 001 001 001 001 001 001 061 001 001 001 001 001 001 001 001 001 001 069 001 069 069 069 001]]> </Row>
<Row> <![CDATA[001 001 001 001 001 001 001 001 001 001 001 061 001 001 001 001 001 001 069 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 069 001 001 001 001 001 061 001 061 001 001 001 001 001 001 001 069 069 061 001 061 001 001]]> </Row>
<Row> <![CDATA[069 001 001 001 061 061 001 001 001 061 001 061 001 001 061 001 001 001 069 001 001 001 001 001 001 001 001 001 001 069 001 001 001 001 001 001 001 001 061 001 001 001 001 061 061 001 001 001 001 001 001 001 001 001 001 001 001 069 069]]> </Row>
<Row> <![CDATA[061 001 001 001 001 061 001 001 001 001 001 001 001 001 001 001 001 069 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 061 001 001 001 001 001 001 001 001 001 001 001 001 001 061 061 061]]> </Row>
<Row> <![CDATA[069 061 001 001 001 001 001 061 001 001 001 001 001 001 001 001 061 001 061 061 001 001 001 061 061 061 061 061 061 069 061 001 061 061 001 061 001 001 061 061 061 061 001 061 061 001 061 001 061 001 001 061 001 001 001 001 061 061 061]]> </Row>
<Row> <![CDATA[069 001 001 001 061 061 061 001 061 001 001 061 061 001 001 001 061 001 061 001 061 061 061 061 061 061 061 061 099 099 099 001 061 001 001 061 001 001 061 061 061 001 061 061 061 001 061 061 001 069 061 001 069 001 061 069 061 061 061]]> </Row>
<Row> <![CDATA[099 099 099 099 001 001 099 099 099 099 099 001 061 061 061 061 061 001 061 061 061 061 061 061 001 061 061 061 099 099 099 061 061 061 061 061 061 061 061 061 061 061 061 061 061 061 061 001 099 099 099 099 099 001 061 099 099 099 099]]> </Row>
<Row> <![CDATA[061 061 061 061 061 061 061 001 061 001 061 061 061 061 061 001 061 061 061 061 061 061 061 061 061 061 061 061 099 099 099 061 061 061 061 061 001 001 001 061 061 001 061 061 061 061 061 001 061 061 001 061 061 001 061 001 061 061 069]]> </Row>
<Row> <![CDATA[061 061 061 001 061 061 061 061 061 061 001 061 061 061 061 001 061 061 061 001 001 001 001 061 061 001 061 061 061 061 001 001 061 061 061 061 061 061 061 061 061 061 061 061 061 061 061 061 061 061 061 061 061 001 061 001 061 061 061]]> </Row>
<Row> <![CDATA[061 001 061 001 001 061 061 061 001 061 061 061 061 001 061 001 061 061 061 061 061 061 061 061 061 061 061 061 061 061 061 001 061 061 061 061 001 061 061 061 061 061 061 061 061 001 061 061 061 061 061 061 061 061 061 061 001 061 061]]> </Row>
<Row> <![CDATA[001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 069 001 001 001 001 001 001 061 061 001 001 001 069 061 001 001 001 001 001 001 001 001 001 001 061 061 061 061 061 001 069 001 001 001 001 061 001 001 061 001 069 069 001]]> </Row>
<Row> <![CDATA[069 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 069 001 069 001 001 065 001 001 001 001 001 001 069 069 001 001 069 001 001 001 001 001 001 069 061 001 001 001 001 001 069 001 001 001 001 001 001 001 001 001 001 001 069]]> </Row>
<Row> <![CDATA[001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 069 069 001 001 001 001 001 061 001 061 061 069 001 001 001 061 001 001 001 001 001 001 001 001 001 061 061 061 001 001 001 001 001 001 001 001 001 001 001 061 001 001]]> </Row>
<Row> <![CDATA[069 001 001 001 001 001 001 001 061 001 001 001 061 001 001 001 001 069 061 001 001 001 001 001 001 001 001 001 001 069 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 061 001 001 001 001 061 061 061 069 001]]> </Row>
<Row> <![CDATA[069 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 061 069 001 001 001 001 001 001 001 001 001 001 001 001 001 061 001 001 001 001 001 001 001 061 001 001 061 061 001 061 061 061 001 001 001 061 001 061 001 061 001 069]]> </Row>
<Row> <![CDATA[069 001 001 001 001 001 001 001 001 001 001 001 061 001 001 001 061 061 061 001 001 001 061 001 001 061 001 001 001 061 069 001 001 001 001 001 001 001 001 001 001 061 061 001 001 001 001 001 001 061 001 001 001 001 001 061 069 069 001]]> </Row>
<Row> <![CDATA[069 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 069 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 061 001 001 001 001 061 001 069 001 001 001 001 061 069 001]]> </Row>
<Row> <![CDATA[069 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 061 001 069 001 061 001 001 001 001 061 001 061 061 001 001 001 061 061 001 061 001 001 061 001 061 069 061 001 061 001 001 001 001 001 001 001 001 001 001 001 001 001 001]]> </Row>
<Row> <![CDATA[069 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 069 001 001 001 001 001 001 001 001 001 001 069 001 001 001 001 001 001 001 001 001 069 001 001 001 069 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001]]> </Row>
<Row> <![CDATA[069 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 069 001 001 001 001 001 001 001 001 001 069 069 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001]]> </Row>
<Row> <![CDATA[069 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 069 069 001 001 001 001 001 001 001 001 001 069 069 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001]]> </Row>
<Row> <![CDATA[069 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 069 001 001 001 001 001 001 001 001 001 001 069 069 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 069 001 061 061 001 001 001 001 001 001 069 001 001 001]]> </Row>
<Row> <![CDATA[069 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 069 001 001 001 001 001 001 001 001 001 069 069 001 069 001 001 001 001 069 001 001 069 001 001 001 001 001 001 001 069 001 001 001 001 001 001 001 001 001 001 001]]> </Row>
<Row> <![CDATA[069 001 001 069 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 069 001 001 001 001 001 001 001 001 001 001 001 001 001 001 061 001 001 001 001 069 001 001 001 001 001 001 061 069 001]]> </Row>
<Row> <![CDATA[069 069 001 069 001 001 001 001 001 001 001 001 001 001 001 001 001 069 069 001 001 001 001 001 001 001 001 001 001 069 001 001 001 001 001 001 001 069 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 061 061 069 069 069]]> </Row>
<Row> <![CDATA[069 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 069 001 001 001 001 001 001 001 001 001 001 001 069 001 001 001 001 001 001 001 001 001 001 064 062 062 062 062 064 064 064 062 062 062 062 064 064 001 001 001 001 001]]> </Row>
<Row> <![CDATA[001 001 069 001 001 069 001 001 001 001 001 001 001 001 001 001 001 069 069 001 001 001 001 001 001 001 001 001 099 099 099 001 001 001 001 001 001 062 062 064 001 001 001 001 001 001 001 001 001 001 001 001 001 001 064 062 064 001 061]]> </Row>
</Data>
</Device>
</Map>
</Maps>
Run Code Online (Sandbox Code Playgroud)

我的 XSLT 专为转换而设计:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" 
                xmlns:xsi= "https://www.w3.org/TR/xmlschema-1/" 
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
                xmlns= "http://www.semi.org"
                xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
                xmlns:outlet = "http://my.functions">



  <msxsl:script implements-prefix="outlet" language="javascript">
    <![CDATA[
    //script to replace string as XSLT1.0 doesnot support replace()
    function replace_str(str_text,str_by)
    {
    return str_text.replace(str_text,str_by);
    }

    //script to find the incoming bin code and idendify if pass/fail/null
    function identify_bin_type(available_bin_codes,search_string) {

    while(available_bin_codes.MoveNext()) {


    var current_bin_code = available_bin_codes.Current.Value;
    if ( current_bin_code === search_string){
    return current_bin_code;
    }
    }
    return "";
    }
    ]]>


  </msxsl:script>

  <xsl:strip-space elements="*"/>

  <!--variable section-->
  <xsl:variable name="Company_Name" select="'xxx'"/>
  <xsl:variable name="Notch_Direction" select="'DOWN'"/>
  <xsl:variable name="Device_Name" select="'EMAX-00'"/>
  <xsl:variable name="Pass_Bin_ASE_Code" select="'1'"/>
  <xsl:variable name="Fail_Bin_ASE_Code" select="'0'"/>
  <xsl:variable name="Null_Bin_ASE_Code" select="'X'"/>
  <xsl:variable name="Miss_Bin_ASE_Code" select="'0'"/>

  <xsl:variable name="Machine_Id" select="/node()[1]/node()[1]/node()[1]/@MachineID"/>

  <xsl:variable name="Wafer_Id" select="/node()[1]/node()[1]/@SubstrateId"/>

  <xsl:variable name="Bin1_Count" select="/node()[1]/node()[1]/node()[1]/node()[2]/*[@BinCode='001']/@BinCount"/>

  <xsl:variable name="Column_Value" select="/node()[1]/node()[1]/node()[1]/@Columns"/>
  <xsl:variable name="Row_Value" select="/node()[1]/node()[1]/node()[1]/@Rows"/>

  <xsl:variable name="Actual_Die_Nos" select="number($Column_Value) * number($Row_Value)"/>

  <xsl:variable name="Total_Die_Nos" select="sum(/node()[1]/node()[1]/node()[1]/node()[2]/*[@BinCount]/@BinCount)"/>

  <xsl:variable name="Device_Rows" select="/node()[1]/node()[1]/node()[1]/node()[3]/*/text()"/>

  <xsl:variable name="Pass_Bin_Codes" select="/node()[1]/node()[1]/node()[1]/node()[2]/*[@BinQuality='Pass']/@BinCode"/>
  <xsl:variable name="Fail_Bin_Codes" select="/node()[1]/node()[1]/node()[1]/node()[2]/*[@BinQuality='Fail']/@BinCode"/>
  <!--<xsl:variable name="Null_Bin_Codes" select="/node()[1]/node()[1]/node()[1]/node()[2]/*[@BinQuality='Null']/@BinCode"/>-->
  <xsl:variable name="Null_Bin_Codes" select="/node()[1]/node()[1]/node()[1]/@NullBin"/>


  <xsl:output method="text"  indent="yes"/>

  <!--Transpose template called for each Device Row Data-->
  <xsl:template name="find-identify-substitute-bincodes">
    <xsl:param name="string"/>

    <xsl:variable name="relevantSringLen" select="string-length($string)" />


    <xsl:if test="$relevantSringLen &gt; 1">
      <xsl:variable name="relevant-part" select="substring-before(substring-after($string,' '),' ')"/>



      <xsl:choose>

        <!--Check if it a pass bin code and replace with respective pass ASE Code-->
        <xsl:when test="contains(outlet:identify_bin_type($Pass_Bin_Codes,$relevant-part),$relevant-part)">

              <xsl:variable name="transform-relevant-part" select="outlet:replace_str($relevant-part,$Pass_Bin_ASE_Code)" />
              <xsl:value-of select="normalize-space(concat($transform-relevant-part,' '))"/>

        </xsl:when>


        <!--Check if it a fail bin code and replace with respective fail ASE Code-->

        <xsl:when test="contains(outlet:identify_bin_type($Fail_Bin_Codes,$relevant-part),$relevant-part)">

          <xsl:variable name="transform-relevant-part" select="outlet:replace_str($relevant-part,$Fail_Bin_ASE_Code)" />
          <xsl:value-of select="normalize-space(concat($transform-relevant-part,' '))"/>

        </xsl:when>



        <!--Check if it a null bin code and replace with respective null ASE Code-->

        <xsl:when test="contains(outlet:identify_bin_type($Null_Bin_Codes,$relevant-part),$relevant-part)">


              <xsl:variable name="transform-relevant-part" select="outlet:replace_str($relevant-part,$Null_Bin_ASE_Code)" />
              <xsl:value-of select="normalize-space(concat($transform-relevant-part,' '))"/>        

        </xsl:when>

        <!--Check if bin code not found and replace with respective miss ASE Code-->
        <xsl:otherwise>

          <xsl:variable name="transform-relevant-part" select="outlet:replace_str($relevant-part,$Miss_Bin_ASE_Code)" />
          <xsl:value-of select="normalize-space(concat($transform-relevant-part,' '))"/>


        </xsl:otherwise>
      </xsl:choose>

      <!--recursively look into the remainder string in the row and continue serch and replace till the end-->
      <xsl:variable name="remainder" select="substring-after($string,$relevant-part)"/>

      <xsl:call-template name="find-identify-substitute-bincodes">
        <xsl:with-param name="string" select="$remainder"/>
      </xsl:call-template>


    </xsl:if>

  </xsl:template>

  <!--Template of Device Data Rows to be called in main Template-->
  <xsl:template name="Devicedatarow">
    <xsl:for-each select="$Device_Rows">

      <xsl:variable name="Device_Row" select="current()"/>
      <xsl:variable name="Device_Row_Position" select="position()"/>


      <xsl:call-template name="find-identify-substitute-bincodes">
        <xsl:with-param name="string" select="$Device_Row" />

      </xsl:call-template>
      <xsl:text>&#xd;</xsl:text>
    </xsl:for-each>
  </xsl:template>

  <!--Main Text Template body-->
  <xsl:template match="/|@*">

    <xsl:text>Company Name: </xsl:text> 
    <xsl:value-of select="$Company_Name" />
    <xsl:text>&#xd;</xsl:text>

    <xsl:text>Device: </xsl:text>
    <xsl:value-of select="$Device_Name" />
    <xsl:text>&#xd;</xsl:text>

    <xsl:text>MachineID :</xsl:text>
    <xsl:value-of select="substring-after($Machine_Id, 'M/C Name :')" />

    <xsl:text>&#xd;</xsl:text>
    <xsl:text>Wafer ID: </xsl:text>
    <xsl:value-of select="$Wafer_Id" />

    <xsl:text>&#xd;</xsl:text>
    <xsl:text>BIN 1: </xsl:text>
    <xsl:value-of select="$Bin1_Count" />

    <xsl:text>&#xd;</xsl:text>
    <xsl:text>Total Die: </xsl:text>
    <xsl:value-of select="$Total_Die_Nos" />

    <xsl:text>&#xd;</xsl:text>
    <xsl:text>Notch Direction: </xsl:text>

Sim*_*Ged 5

根据 dotnet corefx github 存储库,.NET Core 不支持该功能,目前没有计划实现它。更多详情可在这找到

不幸的是,目前看来您唯一的选择就是坚持使用 .NET Framework。

编辑

我确实喜欢挑战,所以我研究了您的 XSLT,并找到了一个可以在 .NET Core 中运行的解决方案。

我们需要删除 JScript 以消除该错误。因此我们需要用 XSLT 方法替换 JScript 方法。

为了删除,replace-str我环顾四周,找到了一个 XSLT 模板,可以为您进行字符串替换。这是我使用的答案

将模板添加到您的 XSLT

<xsl:template name="string-replace-all">
  <xsl:param name="text" />
  <xsl:param name="replace" />
  <xsl:param name="by" />
  <xsl:choose>
    <xsl:when test="contains($text, $replace)">
      <xsl:value-of select="substring-before($text,$replace)" />
      <xsl:value-of select="$by" />
      <xsl:call-template name="string-replace-all">
        <xsl:with-param name="text" select="substring-after($text,$replace)" />
        <xsl:with-param name="replace" select="$replace" />
        <xsl:with-param name="by" select="$by" />
      </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="$text" />
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Run Code Online (Sandbox Code Playgroud)

并将您的replace_str呼叫替换为答案中的示例

<xsl:variable name="transform-relevant-part">
  <xsl:call-template name="string-replace-all">
    <xsl:with-param name="text" select="$relevant-part" />
    <xsl:with-param name="replace" select="$relevant-part" />
    <xsl:with-param name="by" select="$Pass_Bin_ASE_Code" />
  </xsl:call-template>
</xsl:variable>
Run Code Online (Sandbox Code Playgroud)

现在,您的when子句不需要identify_bin_typeJScript 函数来查找任何匹配项,您可以使用 XSLTcontains方法来查找匹配项:

<xsl:when test="contains($Pass_Bin_Codes, $relevant-part)">
Run Code Online (Sandbox Code Playgroud)

这应该会产生所需的输出。