I would like to output all Charge elements for all Charges, when OffenseID/ID ID=PENDING.
The important thing to note is that the element <OffenseCite>xyz</OffenseCite will be output as <StatuteNumber>xyz</StatuteNumber>
Sample Output for each Charge should look like this. I did not include all elements
Input xml doc
The important thing to note is that the element <OffenseCite>xyz</OffenseCite will be output as <StatuteNumber>xyz</StatuteNumber>
Sample Output for each Charge should look like this. I did not include all elements
XML:
<Charge>
<ReportingAgency>xyz</ReportingAgency>
<Statute>
<StatuteDescription>TRAFFIC - DWI - OPERATE MOTOR VEHICLE - ALCOHOL CONCENTRATION 0.08 WITHIN 2 HOURS</StatuteDescription>
<StatuteNumber>169A.20.1(5)</StatuteNumber>
</Statute>
</Charge>
Input xml doc
XML:
<?xml version="1.0" encoding="UTF-8"?>
<Envelope xmlns:NS1="[URL unfurl="true"]http://www.w3.org/2003/05/soap-envelope">[/URL]
<Body>
<TabChargeDocument>
<Charge>
<ChargeSequenceID>
<ID>1</ID>
</ChargeSequenceID>
<OffenseID>
<ID>PENDING</ID>
</OffenseID>
<OffenseCite>169A.27.1</OffenseCite>
<OffenseDescriptionText>TRAFFIC - DWI - FOURTH-DEGREE DRIVING WHILE IMPAIRED; DESCRIBED</OffenseDescriptionText>
<OffenseDate>2016-09-18</OffenseDate>
<OffenseTime>00:22:00</OffenseTime>
<OffenseDatesOnOrAbout>false</OffenseDatesOnOrAbout>
<SeverityLevelText>Misdemeanor</SeverityLevelText>
<MinnesotaOffenseCode>NBR</MinnesotaOffenseCode>
<Report>
<ReportingAgencyORI>
<ID>MNMHP0400</ID>
</ReportingAgencyORI>
<ReportingAgencyControlNumber>
<ID>16510299</ID>
</ReportingAgencyControlNumber>
<ReportingOfficial>
<OfficerBadgeNumber>
<ID>176</ID>
</OfficerBadgeNumber>
<OfficerNameText>UTES</OfficerNameText>
</ReportingOfficial>
</Report>
<CommunityOfOffenseText>Brooklyn Park</CommunityOfOffenseText>
</Charge>
<Charge>
<ChargeSequenceID>
<ID>2</ID>
</ChargeSequenceID>
<OffenseID>
<ID>PENDING</ID>
</OffenseID>
<OffenseCite>169A.20.1(5)</OffenseCite>
<OffenseDescriptionText>TRAFFIC - DWI - OPERATE MOTOR VEHICLE - ALCOHOL CONCENTRATION 0.08 WITHIN 2 HOURS</OffenseDescriptionText>
<OffenseDate>2016-09-18</OffenseDate>
<OffenseTime>00:22:00</OffenseTime>
<OffenseDatesOnOrAbout>false</OffenseDatesOnOrAbout>
<SeverityLevelText>Misdemeanor</SeverityLevelText>
<Report>
<ReportingAgencyORI>
<ID>MNMHP0400</ID>
</ReportingAgencyORI>
<ReportingAgencyControlNumber>
<ID>16510299</ID>
</ReportingAgencyControlNumber>
<ReportingOfficial>
<OfficerBadgeNumber>
<ID>176</ID>
</OfficerBadgeNumber>
<OfficerNameText>UTES</OfficerNameText>
</ReportingOfficial>
</Report>
<CommunityOfOffenseText>Brooklyn Park</CommunityOfOffenseText>
</Charge>
<Charge>
<ChargeSequenceID>
<ID>3</ID>
</ChargeSequenceID>
<OffenseID>
<ID>PENDING</ID>/Envelope/Body/TabChargeDocument/Charge[3]/OffenseID/ID
</OffenseID>
<OffenseCite>169A.20.1(1)</OffenseCite>
<OffenseDescriptionText>TRAFFIC - DWI - OPERATE MOTOR VEHICLE UNDER INFLUENCE OF ALCOHOL</OffenseDescriptionText>
<OffenseDate>2016-09-18</OffenseDate>
<OffenseTime>00:22:00</OffenseTime>
<OffenseDatesOnOrAbout>false</OffenseDatesOnOrAbout>
<SeverityLevelText>Misdemeanor</SeverityLevelText>
<Report>
<ReportingAgencyORI>
<ID>MNMHP0400</ID>
</ReportingAgencyORI>
<ReportingAgencyControlNumber>
<ID>16510299</ID>
</ReportingAgencyControlNumber>
<ReportingOfficial>
<OfficerBadgeNumber>
<ID>176</ID>
</OfficerBadgeNumber>
<OfficerNameText>UTES</OfficerNameText>
</ReportingOfficial>
</Report>
<CommunityOfOffenseText>Brooklyn Park</CommunityOfOffenseText>
</Charge>
</TabChargeDocument>
</Body>
</Envelope>