我如何使用 BizTalk factoid 来处理这个值

How do I use BizTalk factoid to process this value

我继承了一个 BizTalk 应用程序,该应用程序从 Dynamics CRM 更改事件中获取输入并在映射中使用内联 XSLT。

我正在使用 VS 2013 并使用测试地图(在 Visual Studio 中右键单击地图)。

我有这个输入:

<ns0:DynamicsChangeMessage xmlns:ns0="http://XXXXXX">
<ns0:entity>entity_0</ns0:entity>
<ns0:operation>operation_0</ns0:operation>
<ns0:userId>userId_0</ns0:userId>
<ns0:Changes>
   <ns0:Change>
      <ns0:Key>gcs_universalcredit</ns0:Key>
      <ns0:Value>true</ns0:Value>
   </ns0:Change>
</ns0:Changes>

并且我已将其添加到现有的 XSLT 中:

<xsl:choose>
     <xsl:when test="gcs_universalcredit = 'true'">
         <UniversalCredit>Yes</UniversalCredit>
     </xsl:when>
     <xsl:otherwise>
         <UniversalCredit>No</UniversalCredit>
     </xsl:otherwise>
</xsl:choose>

我得到这个输出:

<ns3:Person mlns:ns3="http://XXXXXX/Schemas/Canonical/Person/1.0" 
xmlns:ns1="http://XXXXXX/Schemas/Canonical/Person/1.0"
xmlns:ns4="http://XXXXXX/Schemas/Canonical/Address/1.0"
xmlns:ns2="http://XXXXXX/Schemas/Canonical/PersonRecord/1.0"
xmlns:ns0="http://XXXXXX/Schemas/Canonical/ProcessHeader/1.0">
<ProcessHeader>
   <Source>DynamicsOnline</Source>
   <ProcessName>ChangeProcessing</ProcessName>
   <ProcessType>Update</ProcessType>
   <ResubmissionCount>0</ResubmissionCount>
   <TrackingId>3920dcdc-99e5-44c7-bd7a-d0039e60f235</TrackingId>
</ProcessHeader>
   <PersonType>
       <ADUserId>NotApplicable</ADUserId>
       <TypeOfPerson>Tenant</TypeOfPerson>
   </PersonType>
   <PersonRecord>
       <UniversalCredit>No</UniversalCredit>
   </PersonRecord>

我浏览了网络并尝试了

的各种表达方式
<xsl:when test="gcs_universalcredit = 'true'">

但我总是得到

<UniversalCredit>No</UniversalCredit>

永远不会是。

我做错了什么?

好的,我已经解决了。

<xsl:when test="string(s0:Changes/s0:Change[s0:Key='gcs_universalcredit']/s0:Value/text()) = 'true'">