Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xml 如何显示与车辆制造商(MncisCode)匹配的NcicCode?_Xml_Xslt - Fatal编程技术网

Xml 如何显示与车辆制造商(MncisCode)匹配的NcicCode?

Xml 如何显示与车辆制造商(MncisCode)匹配的NcicCode?,xml,xslt,Xml,Xslt,我有一个Mercuryelement的xml文档。我想把它和MERC代码匹配。 我的输出仅显示匹配的第一个。引用文档中的代码与我的xml文档中的代码相同 电流输出 梅尔布 所需输出应为NcicCode=MncisCode 美塞苔丝 我的示例xml文档 我的示例引用xml文档 我的示例xslt代码 您还必须在谓词中添加描述节点比较。我猜是这样的: <xsl:variable name="vVehicleMakeCode" select="document(concat($gEnvPa

我有一个Mercuryelement的xml文档。我想把它和MERC代码匹配。 我的输出仅显示匹配的第一个。引用文档中的代码与我的xml文档中的代码相同

电流输出

梅尔布

所需输出应为NcicCode=MncisCode

美塞苔丝

我的示例xml文档

我的示例引用xml文档

我的示例xslt代码

您还必须在谓词中添加描述节点比较。我猜是这样的:

<xsl:variable name="vVehicleMakeCode" select="document(concat($gEnvPath,'\ConfigFiles\VehicleMakeMapping.xml'))/VehicleMakeMapping/Mapping[MncisCode=$vVehicleMake and Description=$vVehicleMakeContent]/NcicCode"/>

在示例文档中,所有映射元素都具有相同的MncisCode,那么它如何知道要匹配哪一个呢?谢谢这个问题与您之前的问题有什么不同:?业务分析师说要使用车辆也要做描述。。返回的VehicleMake值将基于MNCIS代码。NCIC代码与MNCI中使用的车辆制造代码不匹配。当XML中的结果包括VehicleMake时,将MNCIS值转换为VehicleMake映射文档中匹配的NCIC值。如果为MNCIS代码找到多个NCIC代码,请查找精确匹配并填充,否则跳过此元素。如果找不到MNCIS代码的NCIC代码,则跳过填充元素。业务人员告诉我要查找/Integration/Case/Charge/Vehicle/VehicleMake/@Word code和NCCCode之间的精确匹配。如果没有找到匹配项,则我需要跳过它,即不显示它。因此,在我的例子中,基于我拥有的xml文档,输出应该像这个MERC,因为MERC同时匹配NcicCode和MncisCodeJoel,业务分析师要求我在查找NcicCode和MncisCode之间的精确匹配时不要使用description。因此,我不确定要在xsl上更改什么,以便在映射中循环查找NcicCode和MNCICODE之间的精确匹配xml文档具有/Integration/Case/Charge/Vehicle/VehicleMake/@Word@Word是我需要与映射文档中的NcicCode匹配的MNCICODE。如果NcicCode和MncisCode之间没有精确匹配,则我不需要显示代码。我该怎么做?
    <?xml version="1.0" encoding="UTF-8"?>
<VehicleMakeMapping>
    <Mapping>
        <NcicCode>MERB</NcicCode>
        <MncisCode>MERC</MncisCode>
        <Description>Mercury Boat Co.</Description>
    </Mapping>
    <Mapping>
        <NcicCode>MERC</NcicCode>
        <MncisCode>MERC</MncisCode>
        <Description>Mercury</Description>
    </Mapping>
    <Mapping>
        <NcicCode>MERH</NcicCode>
        <MncisCode>MERC</MncisCode>
        <Description>Mercury Coach Corp.</Description>
    </Mapping>
    <Mapping>
        <NcicCode>MERR</NcicCode>
        <MncisCode>MERC</MncisCode>
        <Description>Mercury Trailer Industries</Description>
    </Mapping>
    <Mapping>
        <NcicCode>METE</NcicCode>
        <MncisCode>MERC</MncisCode>
        <Description>Meteor (Canadian Mercury)</Description>
    </Mapping>
    <Mapping>
        <NcicCode>MRCU</NcicCode>
        <MncisCode>MERC</MncisCode>
        <Description>Mercury (See Mercury Marine)</Description>
    </Mapping>
</VehicleMakeMapping>
<j:VehicleMakeCode>
        <xsl:variable name="vVehicleMakeCode" select="document(concat($gEnvPath,'\ConfigFiles\VehicleMakeMapping.xml'))/VehicleMakeMapping/Mapping[MncisCode=$vVehicleMake]/NcicCode"/>
        <xsl:value-of select="$vVehicleMakeCode"/>
</j:VehicleMakeCode>
<xsl:variable name="vVehicleMakeCode" select="document(concat($gEnvPath,'\ConfigFiles\VehicleMakeMapping.xml'))/VehicleMakeMapping/Mapping[MncisCode=$vVehicleMake and Description=$vVehicleMakeContent]/NcicCode"/>
<xsl:variable name="vVehicleMakeCode" select="document(concat($gEnvPath,'\ConfigFiles\VehicleMakeMapping.xml'))/VehicleMakeMapping/Mapping[MncisCode=$vVehicleMake and MncisCode=NcicCode]/NcicCode"/>