My xml document has /Integration/Case/Charge/Vehicle/VehicleMake/@Word where the @Word is the MncisCode that is found in the Mapping of the referring document and it should be matched to NcicCode in the Mapping.
I am not sure what to change on my xsl to loop through the Mapping looking for exact match between NcicCode and MncisCode.
If there is not an exact match between NcicCode and MncisCode then I need not display any code.
How do I do this?
Desired output
sample xml document
Sample referring xml document with the Mapping elements.
My sample xslt code 1.0
I am not sure what to change on my xsl to loop through the Mapping looking for exact match between NcicCode and MncisCode.
If there is not an exact match between NcicCode and MncisCode then I need not display any code.
How do I do this?
Desired output
XML:
<ext:Vehicle>
<j:VehicleMakeCode>MERC</j:VehicleMakeCode>
</ext:Vehicle>
sample xml document
XML:
<Integration xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:tsg="[URL unfurl="true"]http://tsgweb.com"[/URL] xmlns:IXML="[URL unfurl="true"]http://tsgweb.com"[/URL] xmlns:CMCodeQueryHelper="urn:CMCodeQueryHelper" PackageID="DL Notice to DVS" MessageID="67092480" xmlns="">
<Case Op="E" InternalID="1617090885" ID="12126951" xmlns:user="[URL unfurl="true"]http://tylertechnologies.com">[/URL]
<Charge ID="10906495" PartyID="1466236" InternalChargeID="1616714163" InternalPartyID="704451330" xmlns:reslib="urn:reslib">
<ChargeOffenseDate>06/05/2015</ChargeOffenseDate>
<Vehicle>
<VehicleMake Word="MERC">Mercury</VehicleMake>
</Vehicle>
</Charge>
</Case>
<Citation ID="5385632" xmlns:user="[URL unfurl="true"]http://tylertechnologies.com">[/URL]
<CitationNumber>TLA060515C</CitationNumber>
<TicketDate>06/05/2015</TicketDate>
<Vehicle>
<VehicleMake Word="MERC">Mercury</VehicleMake>
</Vehicle>
</Citation>
</Integration>
Sample referring xml document with the Mapping elements.
XML:
<?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>
My sample xslt code 1.0
Code:
<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>