Jump to content

winkimjr2

Members
  • Content count

    42
  • Joined

  • Last visited

Community Reputation

0 Neutral

About winkimjr2

  • Rank
    Newbie

Profile Information

  • Gender
    Male
  • Location
    DC
  1. I resolved this using position()=1
  2. I would like to output the first FamilyJudgement from my xml document. How do I do it? Expected output <FamilyJudgment judgmentKey="3928551"> <JudgmentEventTypeText>Custody order</JudgmentEventTypeText> </FamilyJudgment> xml document <?xml version="1.0" encoding="UTF-8"?> <CaseNotification> <CourtDecisionNotification> <TriggeredDateTime>2016-07-12T15:05:45-05:00</TriggeredDateTime> <NotificationEvent>CourtDecisionModified</NotificationEvent> <FamilyJudgment judgmentKey="3928551"> <JudgmentEventTypeText>Custody order</JudgmentEventTypeText> <JudgmentEventDate>2016-07-12</JudgmentEventDate> <Custody> <CustodyDescriptionText>Legal custody</CustodyDescriptionText> </Custody> </FamilyJudgment> <FamilyJudgment judgmentKey="3928551"> <JudgmentEventTypeText>Custody order</JudgmentEventTypeText> <JudgmentEventDate>2016-07-12</JudgmentEventDate> <Custody> <CustodyDescriptionText>Legal custody</CustodyDescriptionText> </Custody> </FamilyJudgment> </CourtDecisionNotification> </CaseNotification>
  3. I would like to use variable vCurrentPoStatus in the select statement below. The following select is not returning anything. <xsl:value-of select="Type/@Word"/> I would like to use variable vCurrentPoStatus inside this statement to get the @Word (DISMISSED). Desired output based on current xml document <NotificationEvent notificationType="ProtectionOrderInactivation" internalProtectionOrderID="11271" protectionOrderNumber="1605935" protectionOrderStatusDate="07/21/2016" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions">DISMISSED</NotificationEvent> xslt code <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:mscef="courts.state.mn.us/extfun" xmlns:msxsl="urn:schemas-microsoft-com:xslt"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template match="/"> <xsl:if test="Integration/Case/SecurityGroup[not(contains(@Word,'SEAL'))] or not(Integration/Case/SecurityGroup)"> <xsl:call-template name="ProtectionOrderInactivation"/> </xsl:if> </xsl:template> <!-- --> <xsl:template name="ProtectionOrderInactivation"> <xsl:if test="Integration/ControlPoint='SAVE-PROTECTION-ORDER'"> <!-- Check for Dismissed --> <xsl:if test="Integration/Case/CaseType/@Word='DMA'"> <xsl:variable name="vControlPointTimestamp" select="mscef:formatDateTimeNumeric(string(/Integration/ControlPoint/@Timestamp))"/> <xsl:for-each select="Integration/ProtectionOrder[@Op='E']/Statuses/Status[((@Op='A') or (@Op='E')) and ((Type/@Word='DISMISSED'))]"> <xsl:variable name="vCurrentPoStatus" select="Statuses/Status[((@Op='A') or (@Op='E'))][mscef:formatDateTimeNumeric(mscef:fixOdysseyTimestamp(string(TimestampCreate))) <=$vControlPointTimestamp][1]/Type/@Word"/> <xsl:if test="$vCurrentPoStatus ='DISMISSED'"> <NotificationEvent notificationType="ProtectionOrderInactivation"> <xsl:attribute name="internalProtectionOrderID"><xsl:value-of select="../../@InternalProtectionOrderID"/></xsl:attribute> <xsl:attribute name="protectionOrderNumber"><xsl:value-of select="../../ProtectionOrderNumber"/></xsl:attribute> <xsl:attribute name="protectionOrderStatusDate"><xsl:value-of select="Date"/></xsl:attribute> <xsl:value-of select="Type/@Word"/> </NotificationEvent> </xsl:if> </xsl:for-each> </xsl:if> </xsl:if> </xsl:template> <!-- --> <msxsl:script language="JScript" implements-prefix="mscef"><![CDATA[ function formatDateTimeNumeric(sDate){ if(sDate.length==0){ return ""; } else{ var oDate=new Date(sDate); var str = oDate.getSeconds(); return "" + oDate.getFullYear().toString() + padZeroes(oDate.getMonth() + 1,2) + padZeroes(oDate.getDate(),2) + padZeroes(oDate.getHours().toString(),2) + padZeroes(oDate.getMinutes(),2) + padZeroes(oDate.getSeconds(),2); } } function fixOdysseyTimestamp(sDate){ /* Replace the ":" between seconds and miliseconds */ if(sDate.length==0){ return ""; } else{ var strParts1 = sDate.split(" "); var strTime = strParts1[1]; var strParts2 = strTime.split(":"); return strParts1[0] + " " + strParts2[0] + ":" + strParts2[1] + ":" + strParts2[2]; } } ]]></msxsl:script> </xsl:stylesheet> xml doc <Integration MessageGUID="79e1bb27-0a4d-47ec-a554-3b59c2518b89" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:tsg="http://tsgweb.com" xmlns:IXML="http://tsgweb.com" xmlns:CMCodeQueryHelper="urn:CMCodeQueryHelper" PackageID="IXML Case Notification Test" MessageID="96" xmlns=""> <ControlPoint Timestamp="7/21/2016 9:49:13 AM" UserID="tessing">SAVE-PROTECTION-ORDER</ControlPoint> <Case InternalID="1623057636" ID="14870832" xmlns:user="http://tylertechnologies.com"> <FiledDate>07/21/2016</FiledDate> <CaseCategory>FAM</CaseCategory> <CaseType Word="DMA">Domestic Abuse</CaseType> <SecurityGroup Word="CONFPOR">Conf - Protective Order</SecurityGroup> <ProtectionOrders> <ProtectionOrder Op="E" InternalProtectionOrderID="11271"> <Deleted>false</Deleted> <ProtectionOrderNumber>1605935</ProtectionOrderNumber> <Issued>07/21/2016</Issued> <Expiration>10/29/2016</Expiration> <Type Word="OFP">Order for Protection</Type> <Statuses> <Status Op="A"> <Current>true</Current> <Active>No</Active> <Date Op="A">07/21/2016</Date> <Type Op="A" Word="DISMISSED">Dismissed</Type> <TimestampCreate Op="A">07/21/2016 09:49:13:763</TimestampCreate> </Status> <Status> <Current>false</Current> <Active>Yes</Active> <Date>07/21/2016</Date> <Type Word="SBJOCOR">Corrected - Signed By Judicial Officer</Type> <TimestampCreate>07/21/2016 09:48:58:313</TimestampCreate> </Status> </Statuses> </ProtectionOrder> </ProtectionOrders> </Case> <Fees xmlns:user="http://tylertechnologies.com"/> <ProtectionOrder Op="E" InternalProtectionOrderID="11271" xmlns:user="http://tylertechnologies.com"> <Deleted>false</Deleted> <ProtectionOrderNumber>1605935</ProtectionOrderNumber> <Issued>07/21/2016</Issued> <Expiration>10/29/2016</Expiration> <Type Word="OFP">Order for Protection</Type> <Statuses> <Status Op="A"> <Current>true</Current> <Active>No</Active> <Date Op="A">07/21/2016</Date> <Type Op="A" Word="DISMISSED">Dismissed</Type> <TimestampCreate Op="A">07/21/2016 09:49:13:763</TimestampCreate> </Status> <Status> <Current>false</Current> <Active>Yes</Active> <Date>07/21/2016</Date> <Type Word="SBJOCOR">Corrected - Signed By Judicial Officer</Type> <TimestampCreate>07/21/2016 09:48:58:313</TimestampCreate> </Status> </Statuses> </ProtectionOrder> </Integration>
  4. How do I use my variable to get ProtectionOrderNumber?

    I did figure out how to use variable in select statement. I wanted to not to duplicate code.
  5. I am using a variable vPoID to determine the right ProtectionOrder. Then I am displaying that PO's @InternalProtectionOrderID. I would also like to use the same variable to get that PO's ProtectionOrderNumber. How can I use the same variable to also get ProtectionOrderNumber? I would like to modify this line to use the variable vPoID to get the ProtectionOrderNumber <xsl:attribute name="protectionOrderNumber"><xsl:value-of select="ProtectionOrderNumber"/></xsl:attribute> Expected output <NotificationEvent notificationType="ProtectionOrderHearing" internalProtectionOrderID="2552" protectionOrderNumber="1600330"/> xslt code <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:mscef="courts.state.mn.us/extfun" xmlns:msxsl="urn:schemas-microsoft-com:xslt"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template match="/"> <xsl:if test="Integration/Case/SecurityGroup[not(contains(@Word,'SEAL'))] or not(Integration/Case/SecurityGroup)"> <xsl:call-template name="ProtectionOrderHearing"/> </xsl:if> </xsl:template> <!-- --> <xsl:template name="ProtectionOrderHearing"> <!--<xsl:if test="Integration/ControlPoint='SAVE-FAM-HEARING'">--> <xsl:if test="Integration/ControlPoint=('SAVE-FAM-HEARING') or ('SAVE-FAM-HEAR-CTS')"> <xsl:if test="Integration/Case/CaseType/@Word='DMA'"> <xsl:for-each select="Integration/Case"> <xsl:variable name="vFoundActivePO"> <xsl:for-each select="/Integration/ProtectionOrder[Deleted='false']"> <xsl:variable name="vControlPointTimestamp" select="mscef:formatDateTimeNumeric(string(/Integration/ControlPoint/@Timestamp))"/> <xsl:variable name="vCurrentPoStatus" select="Statuses/Status[mscef:formatDateTimeNumeric(mscef:fixOdysseyTimestamp(string(TimestampCreate))) <=$vControlPointTimestamp][1]/Type/@Word"/> <xsl:if test="($vCurrentPoStatus ='SBJO') or ($vCurrentPoStatus='SBJOCOR')">HIT</xsl:if> </xsl:for-each> </xsl:variable> <xsl:variable name="vFoundHearingTrigger"> <xsl:choose> <xsl:when test="count(Hearing[@Op='A'])>0">HIT</xsl:when> <xsl:when test="count(Hearing[@Op='D'])>0">HIT</xsl:when> <xsl:when test="count(Hearing[(@Op='E') and (CancelledReason/@Op='E')])>0">HIT</xsl:when> <xsl:when test="count(Hearing[(@Op='E') and (Setting/HearingDate/@Op='E')])>0">HIT</xsl:when> <xsl:when test="count(Hearing[(@Op='E') and (Setting/CourtSessionBlock/StartTime/@Op='E')])>0">HIT</xsl:when> <xsl:when test="count(Hearing/Setting[@Op='A'])>0">HIT</xsl:when> <xsl:when test="count(Hearing[(@Op='E') and (Setting/RescheduledType/@Op='E')])>0">HIT</xsl:when> <xsl:when test="count(Hearing[(@Op='E') and (Setting/CancelledReason/@Op='E')])>0">HIT</xsl:when> <xsl:when test="count(Hearing[(@Op='E') and (Setting/CourtSessionBlock/StartTime/@Op='E')])>0">HIT</xsl:when> </xsl:choose> </xsl:variable> <xsl:if test="(contains($vFoundHearingTrigger,'HIT')) and (contains($vFoundActivePO,'HIT'))"> <xsl:choose> <xsl:when test="count(Hearing/Setting[not(Cancelled)])>0"> <xsl:for-each select="Hearing/Setting[not(Cancelled)]"> <!-- WK 07/19/2016--> <xsl:variable name="vCurrentTimestamp"> <xsl:value-of select="mscef:formatDateTimeNumeric(string(/Integration/ControlPoint/@Timestamp))"/> </xsl:variable> <xsl:variable name="vControlPointTimestamp" select="mscef:formatDateTimeNumeric(string(/Integration/ControlPoint/@Timestamp))"/> <!--WK 07/19/2016 variable to hold ProtectionOrders that have not been deleted--> <xsl:variable name="vPoID"> <!--WK 07/19/2016 Select all ProtectionOrder elements from the document that are not deleted--> <xsl:for-each select="//Integration/ProtectionOrder[Deleted='false']"> <xsl:variable name="vCurrentPoStatus" select="Statuses/Status[mscef:formatDateTimeNumeric(mscef:fixOdysseyTimestamp(string(TimestampCreate))) <=$vCurrentTimestamp][1]/Type/@Word"/> <xsl:if test="($vCurrentPoStatus ='SBJO') or ($vCurrentPoStatus='SBJOCOR')"> <xsl:value-of select="@InternalProtectionOrderID"/> </xsl:if> </xsl:for-each> </xsl:variable> <NotificationEvent notificationType="ProtectionOrderHearing"> <!--WK 07/19/2016 variable vPoID to get the right PO's attribute @InternalProtectionOrderID>--> <xsl:attribute name="internalProtectionOrderID"><xsl:value-of select="$vPoID"/></xsl:attribute> <xsl:attribute name="protectionOrderNumber"><xsl:value-of select="ProtectionOrderNumber"/></xsl:attribute> </NotificationEvent> </xsl:for-each> </xsl:when> <xsl:otherwise> <NotificationEvent notificationType="ProtectionOrderHearing"> <xsl:attribute name="internalProtectionOrderID"><xsl:value-of select="//Integration/ProtectionOrder[Deleted='false'][count(Statuses/Status[(Type/@Word='SBJO') or (Type/@Word='SBJOCOR')])>0]/@InternalProtectionOrderID"/></xsl:attribute> <xsl:attribute name="protectionOrderNumber"><xsl:value-of select="//Integration/ProtectionOrder[Deleted='false'][count(Statuses/Status[(Current='true') and ((Type/@Word='SBJO') or (Type/@Word='SBJOCOR'))])>0]/ProtectionOrderNumber"/><xsl:value-of select="//Integration/ProtectionOrder[Deleted='false'][count(Statuses/Status[(Type/@Word='SBJO') or (Type/@Word='SBJOCOR')])>0]/ProtectionOrderNumber"/></xsl:attribute> <xsl:text>NoHearings</xsl:text> </NotificationEvent> </xsl:otherwise> </xsl:choose> </xsl:if> </xsl:for-each> </xsl:if> </xsl:if> </xsl:template> <!-- --> <msxsl:script language="JScript" implements-prefix="mscef"><![CDATA[ function formatDateTimeNumeric(sDate){ if(sDate.length==0){ return ""; } else{ var oDate=new Date(sDate); var str = oDate.getSeconds(); return "" + oDate.getFullYear().toString() + padZeroes(oDate.getMonth() + 1,2) + padZeroes(oDate.getDate(),2) + padZeroes(oDate.getHours().toString(),2) + padZeroes(oDate.getMinutes(),2) + padZeroes(oDate.getSeconds(),2); } } function currentDateTimeNumeric(){ var oDate=new Date(); var str = oDate.getSeconds(); return "" + oDate.getFullYear().toString() + padZeroes(oDate.getMonth() + 1,2) + padZeroes(oDate.getDate(),2) + padZeroes(oDate.getHours().toString(),2) + padZeroes(oDate.getMinutes(),2) + padZeroes(oDate.getSeconds(),2); } function fixOdysseyTimestamp(sDate){ /* Replace the ":" between seconds and miliseconds */ if(sDate.length==0){ return ""; } else{ var strParts1 = sDate.split(" "); var strTime = strParts1[1]; var strParts2 = strTime.split(":"); return strParts1[0] + " " + strParts2[0] + ":" + strParts2[1] + ":" + strParts2[2]; } } ]]></msxsl:script> </xsl:stylesheet> xml document <Integration xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:tsg="http://tsgweb.com" xmlns:IXML="http://tsgweb.com" xmlns:CMCodeQueryHelper="urn:CMCodeQueryHelper" PackageID="BCA PO Notification" MessageID="82119264" xmlns=""> <ControlPoint Timestamp="7/14/2016 9:00:52 AM">SAVE-FAM-HEARING</ControlPoint> <Case> <FiledDate>07/14/2016</FiledDate> <CaseCategory>FAM</CaseCategory> <CaseType Word="DMA">Domestic Abuse</CaseType> <BaseCaseType>Civil Domestic Violence</BaseCaseType> <SecurityGroup Word="CONFPOR">Conf - Protective Order</SecurityGroup> <Active>true</Active> <Deleted>false</Deleted> <Assignment Current="true"> <AssignmentDate>07/14/2016</AssignmentDate> <TimestampCreate>07/14/2016 08:56:32:707</TimestampCreate> </Assignment> <Hearing ID="175088126" InternalHearingEventID="1734552990"> <HearingType Word="ADJ">Adjudicatory Hearing</HearingType> <HearingTypeBaseCaseCategory>Criminal</HearingTypeBaseCaseCategory> <HearingTypeBaseCaseCategory>Family</HearingTypeBaseCaseCategory> <TimestampCreate>07/14/2016 08:58:22:160</TimestampCreate> <Setting ID="25760837" InternalSettingID="1625564128" Date="07/14/2016"> <HearingDate>07/14/2016</HearingDate> <StartTime>10:00 AM</StartTime> <EndTime>11:00 AM</EndTime> <CourtSessionName>Ad-Hoc_10-FA-16-40</CourtSessionName> <CourtSessionID ID="3862219" InternalCourtSessionID="1612936893"/> <Calendar Word="10GEN">New General Carver</Calendar> <CalendarBaseCaseCategory>Criminal</CalendarBaseCaseCategory> <CalendarBaseCaseCategory>Civil</CalendarBaseCaseCategory> <CalendarBaseCaseCategory>Family</CalendarBaseCaseCategory> <CalendarBaseCaseCategory>Probate or Mental Health</CalendarBaseCaseCategory> <CourtSessionBlock InternalCourtSessionBlockID="1615773709"> <StartTime>10:00 AM</StartTime> <EndTime>11:00 AM</EndTime> </CourtSessionBlock> <TimestampCreate>07/14/2016 08:58:23:240</TimestampCreate> </Setting> </Hearing> <Hearing ID="175088128" InternalHearingEventID="1734552992" Op="A"> <HearingType Op="A" Word="OFP">Order for Protection Hearing</HearingType> <HearingTypeBaseCaseCategory>Family</HearingTypeBaseCaseCategory> <TimestampCreate Op="A">07/14/2016 09:00:52:680</TimestampCreate> <Setting ID="25760838" InternalSettingID="1625564129" Date="07/14/2016" Op="A"> <HearingDate Op="A">07/14/2016</HearingDate> <StartTime Op="A">2:00 PM</StartTime> <EndTime Op="A">3:00 PM</EndTime> <CourtSessionName>Ad-Hoc_10-FA-16-40</CourtSessionName> <CourtSessionID Op="A" ID="3862221" InternalCourtSessionID="1612936894"/> <Calendar Op="A" Word="10GEN">New General Carver</Calendar> <CalendarBaseCaseCategory>Criminal</CalendarBaseCaseCategory> <CalendarBaseCaseCategory>Civil</CalendarBaseCaseCategory> <CalendarBaseCaseCategory>Family</CalendarBaseCaseCategory> <CalendarBaseCaseCategory>Probate or Mental Health</CalendarBaseCaseCategory> <CourtSessionBlock InternalCourtSessionBlockID="1615773710"> <StartTime Op="A">2:00 PM</StartTime> <EndTime Op="A">3:00 PM</EndTime> </CourtSessionBlock> <TimestampCreate Op="A">07/14/2016 09:00:52:767</TimestampCreate> </Setting> </Hearing> </Case> <ProtectionOrder InternalProtectionOrderID="2551" xmlns:user="http://tylertechnologies.com"> <Deleted>false</Deleted> <ProtectionOrderNumber>1600329</ProtectionOrderNumber> <Type Word="EXPARTE">Ex Parte Order for Protection</Type> <Statuses> <Status> <Current>true</Current> <Active>No</Active> <Date>07/14/2016</Date> <Type Word="SUPERSEDED">Superseded</Type> <TimestampCreate>07/14/2016 09:00:25:510</TimestampCreate> </Status> </ProtectionOrder> <ProtectionOrder InternalProtectionOrderID="2552" xmlns:user="http://tylertechnologies.com"> <Deleted>false</Deleted> <ProtectionOrderNumber>1600330</ProtectionOrderNumber> <Type Word="EXPARTE">Ex Parte Order for Protection</Type> <Statuses> <Status> <Current>true</Current> <Active>Yes</Active> <Date>07/14/2016</Date> <Type Word="SBJO">Signed By Judicial Officer</Type> <TimestampCreate>07/14/2016 09:00:25:547</TimestampCreate> </Status> </Statuses> </ProtectionOrder> </Integration>
  6. How do I Add exception to code based on conditions

    I resolved this
  7. I had this question posted but since I had to edit that question after an answer was provided, I think the best thing to do is posting a new question instead. I have 4 TransactionTypeText being handled by xslt code which include TransactionTypeText='Charge', TransactionTypeText='Payment', TransactionTypeText='Credit', TransactionTypeText='Disbursement'. The problem is that, this code is not handling other types (TransactionTypeText) that are not one of the the 4 types. When I try TransactionTypeText='Adjustment', I am getting an error Unknown transaction type Adjustment because I have an exception in my xslt code to handle TransactionTypeText when it is of type other than the 4. So I would like to modify my code so that it can handle all types of TransactionTypeText. The requirement is that, to handle (other) TransactionTypeText that are not of type Charge, Credit, Disbursement, Payment, use the following condition: For TransactionTypeText that are not Charge; Payment; Credit, and Disbursement get amount that is not equal to zero from any of the amount elements. This is because amount can be in any element. Note: Unlike the 4 types, other types can have amount in any element. The amount for Charge is in ChargeAmount element, amount for Payment is in PaymentAmount element, amount for Disbursement is in DisbursementAmount element, amount for Credit is in CreditAmount. This is not the case for other tpes. So, for other types, I need to get amount from any element that has amount that is great than zero. Note: For each of the other types, only one of the amount elements can have amount greater than zero. If there is more than one amount element with amount that is greater than zero, add exception with exception text "Transaction has more than one amount type" Currently I am only handling (exception) when the TransactionTypeText is not one of the 4 (Charge, Payment, Credit, Disbursement. This is the specific are of xslt I need to modify but I don't know how. <xsl:choose> <xsl:when test="../TransactionTypeText='Charge'"> <xsl:value-of select="mscef:formatCurrency(string(ChargeAmount))"/> </xsl:when> <xsl:when test="../TransactionTypeText='Payment'"> <xsl:value-of select="mscef:formatCurrency(string(PaymentAmount))"/> </xsl:when> <xsl:when test="../TransactionTypeText='Credit'"> <xsl:value-of select="mscef:formatCurrency(string(CreditAmount))"/> </xsl:when> <xsl:when test="../TransactionTypeText='Disbursement'"> <xsl:value-of select="mscef:formatCurrency(string(DisbursementAmount))"/> </xsl:when> <xsl:otherwise> <xsl:message terminate="yes">Unknown transaction type. <xsl:value-of select="../TransactionTypeText"/> </xsl:message> </xsl:otherwise> </xsl:choose> Expected output <FinancialDetail> <FinancialTransaction> <TransactionID>1639560336</TransactionID> <TransactionTypeText>Charge</TransactionTypeText> <TransactionDate>2016-07-11</TransactionDate> <TransactionFeeDetail> <FeeDetailID>1650110685</FeeDetailID> <FeeDetailFeeCodeText code="REST">Restitution</FeeDetailFeeCodeText> <FeeDetailFeeAmount>500</FeeDetailFeeAmount> </TransactionFeeDetail> <TransactionCommentText/> <TransactionPaymentCreditTypeText/> </FinancialTransaction> <FinancialTransaction> <TransactionID>1639560337</TransactionID> <TransactionTypeText>Adjustment</TransactionTypeText> <TransactionDate>2016-07-11</TransactionDate> <TransactionFeeDetail> <FeeDetailID>1650110685</FeeDetailID> <FeeDetailFeeCodeText code="REST">Restitution</FeeDetailFeeCodeText> <FeeDetailFeeAmount>-500</FeeDetailFeeAmount> </TransactionFeeDetail> <TransactionCommentText>Testing</TransactionCommentText> <TransactionPaymentCreditTypeText/> </FinancialTransaction> </FinancialDetail> xslt stylesheet <xsl:stylesheet version="1.0" xmlns="http://www.courts.state.mn.us/CourtXML/3" xmlns:msc="http://www.courts.state.mn.us/CourtXML/3" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:mscef="courts.state.mn.us/extfun" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="mscef msxsl msc"> <xsl:output method="xml" encoding="UTF-8"/> <xsl:template name="FinancialDetailType"> <xsl:for-each select="ancestor::Integration/FinancialDetail/Transaction[count(TransactionFeeDetail[FeeDetailFeeCode='REST'])>0]"> <FinancialTransaction> <TransactionID> <xsl:value-of select="TransactionID"/> </TransactionID> <TransactionTypeText> <xsl:value-of select="TransactionTypeText"/> </TransactionTypeText> <TransactionDate> <xsl:value-of select="substring(TransactionDate,1,10)"/> </TransactionDate> <xsl:for-each select="TransactionFeeDetail[FeeDetailFeeCode='REST']"> <TransactionFeeDetail> <FeeDetailID> <xsl:value-of select="FeeDetailID"/> </FeeDetailID> <FeeDetailFeeCodeText> <xsl:attribute name="code"> <xsl:value-of select="FeeDetailFeeCode"/> </xsl:attribute> <xsl:value-of select="FeeDetailFeeCodeText"/> </FeeDetailFeeCodeText> <FeeDetailFeeAmount> <xsl:choose> <xsl:when test="../TransactionTypeText='Charge'"> <xsl:value-of select="mscef:formatCurrency(string(ChargeAmount))"/> </xsl:when> <xsl:when test="../TransactionTypeText='Payment'"> <xsl:value-of select="mscef:formatCurrency(string(PaymentAmount))"/> </xsl:when> <xsl:when test="../TransactionTypeText='Credit'"> <xsl:value-of select="mscef:formatCurrency(string(CreditAmount))"/> </xsl:when> <xsl:when test="../TransactionTypeText='Disbursement'"> <xsl:value-of select="mscef:formatCurrency(string(DisbursementAmount))"/> </xsl:when> <xsl:otherwise> <xsl:message terminate="yes">Unknown transaction type. <xsl:value-of select="../TransactionTypeText"/> </xsl:message> </xsl:otherwise> </xsl:choose> </FeeDetailFeeAmount> </TransactionFeeDetail> </xsl:for-each> <TransactionCommentText> <xsl:value-of select="TransactionCommentText"/> </TransactionCommentText> <TransactionPaymentCreditTypeText> <xsl:value-of select="TransactionPaymentCreditTypeText"/> </TransactionPaymentCreditTypeText> </FinancialTransaction> </xsl:for-each> </xsl:template> <msxsl:script language="JScript" implements-prefix="mscef"> <![CDATA[ function formatCurrency(asCurrency){ asCurrency = asCurrency.replace("\$",""); asCurrency = asCurrency.replace("\,",""); return parseFloat(asCurrency); } function formatTwoDecimalCurrency(asCurrency){ if(asCurrency.length==0){ return ""; } asCurrency = asCurrency.replace("\$",""); asCurrency = asCurrency.replace("\,",""); return parseFloat(asCurrency).toFixed(2); } ]]></msxsl:script> </xsl:stylesheet> xml document <Integration> <Case InternalID="1612988653" ID="5226206" xmlns:user="http://tylertechnologies.com"> </Case> <FinancialDetail> <Transaction> <TransactionID>1621246445</TransactionID> <TransactionTypeText>Charge</TransactionTypeText> <TransactionDate>2010-06-30T00:00:00</TransactionDate> <TransactionFeeDetail> <FeeDetailID>1624242662</FeeDetailID> <FeeDetailFeeCode>CRMTRAF5</FeeDetailFeeCode> <FeeDetailFeeCodeText>Crim/Traffic Surcharge 2005</FeeDetailFeeCodeText> <ChargeAmount>72.0000</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>0.0000</DisbursementAmount> <PaymentAmount>0.0000</PaymentAmount> <RecipientAccountID>1610014856</RecipientAccountID> <NameLast>MN Department of Finance</NameLast> </TransactionFeeDetail> <TransactionFeeDetail> <FeeDetailID>1624242663</FeeDetailID> <FeeDetailFeeCode>LAWLIBCR</FeeDetailFeeCode> <FeeDetailFeeCodeText>Law Library Criminal</FeeDetailFeeCodeText> <ChargeAmount>10.0000</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>0.0000</DisbursementAmount> <PaymentAmount>0.0000</PaymentAmount> <RecipientAccountID>1610014856</RecipientAccountID> <NameLast>MN Department of Finance</NameLast> </TransactionFeeDetail> <TransactionFeeDetail> <FeeDetailID>1624242664</FeeDetailID> <FeeDetailFeeCode>MUNICCTY</FeeDetailFeeCode> <FeeDetailFeeCodeText>Municipal Fines-County Share</FeeDetailFeeCodeText> <ChargeAmount>233.3800</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>0.0000</DisbursementAmount> <PaymentAmount>0.0000</PaymentAmount> <RecipientAccountID>1610014856</RecipientAccountID> <NameLast>MN Department of Finance</NameLast> </TransactionFeeDetail> <TransactionFeeDetail> <FeeDetailID>1624242665</FeeDetailID> <FeeDetailFeeCode>10CHAS23</FeeDetailFeeCode> <FeeDetailFeeCodeText>Chaska (0300) 2/3</FeeDetailFeeCodeText> <ChargeAmount>466.6200</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>0.0000</DisbursementAmount> <PaymentAmount>0.0000</PaymentAmount> <RecipientAccountID>1610014856</RecipientAccountID> <NameLast>MN Department of Finance</NameLast> </TransactionFeeDetail> <TransactionFeeDetail> <FeeDetailID>1624242666</FeeDetailID> <FeeDetailFeeCode>CRTCOSTS</FeeDetailFeeCode> <FeeDetailFeeCodeText>Court Costs</FeeDetailFeeCodeText> <ChargeAmount>3.0000</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>0.0000</DisbursementAmount> <PaymentAmount>0.0000</PaymentAmount> <RecipientAccountID>1610014856</RecipientAccountID> <NameLast>MN Department of Finance</NameLast> </TransactionFeeDetail> <TransactionFeeDetail> <FeeDetailID>1624242667</FeeDetailID> <FeeDetailFeeCode>PROSCOSTS</FeeDetailFeeCode> <FeeDetailFeeCodeText>Prosecution Costs</FeeDetailFeeCodeText> <ChargeAmount>700.0000</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>0.0000</DisbursementAmount> <PaymentAmount>0.0000</PaymentAmount> <RecipientAccountID>1610014856</RecipientAccountID> <NameLast>MN Department of Finance</NameLast> </TransactionFeeDetail> </Transaction> <Transaction> <TransactionID>1621279946</TransactionID> <TransactionTypeText>Charge</TransactionTypeText> <TransactionDate>2010-07-06T00:00:00</TransactionDate> <TransactionFeeDetail> <FeeDetailID>1624281693</FeeDetailID> <FeeDetailFeeCode>CRTCOSTS</FeeDetailFeeCode> <FeeDetailFeeCodeText>Court Costs</FeeDetailFeeCodeText> <ChargeAmount>20.0000</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>0.0000</DisbursementAmount> <PaymentAmount>0.0000</PaymentAmount> <RecipientAccountID>1610014856</RecipientAccountID> <NameLast>MN Department of Finance</NameLast> </TransactionFeeDetail> </Transaction> <Transaction> <TransactionID>1621541452</TransactionID> <TransactionTypeText>Payment</TransactionTypeText> <TransactionDate>2010-08-06T00:00:00</TransactionDate> <TransactionFeeDetail> <FeeDetailID>1624242664</FeeDetailID> <FeeDetailFeeCode>MUNICCTY</FeeDetailFeeCode> <FeeDetailFeeCodeText>Municipal Fines-County Share</FeeDetailFeeCodeText> <ChargeAmount>0.0000</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>0.0000</DisbursementAmount> <PaymentAmount>32.2800</PaymentAmount> <RecipientAccountID>1610014856</RecipientAccountID> <NameLast>MN Department of Finance</NameLast> </TransactionFeeDetail> <TransactionFeeDetail> <FeeDetailID>1624242665</FeeDetailID> <FeeDetailFeeCode>10CHAS23</FeeDetailFeeCode> <FeeDetailFeeCodeText>Chaska (0300) 2/3</FeeDetailFeeCodeText> <ChargeAmount>0.0000</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>0.0000</DisbursementAmount> <PaymentAmount>64.5400</PaymentAmount> <RecipientAccountID>1610014856</RecipientAccountID> <NameLast>MN Department of Finance</NameLast> </TransactionFeeDetail> <TransactionFeeDetail> <FeeDetailID>1624242666</FeeDetailID> <FeeDetailFeeCode>CRTCOSTS</FeeDetailFeeCode> <FeeDetailFeeCodeText>Court Costs</FeeDetailFeeCodeText> <ChargeAmount>0.0000</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>0.0000</DisbursementAmount> <PaymentAmount>0.4100</PaymentAmount> <RecipientAccountID>1610014856</RecipientAccountID> <NameLast>MN Department of Finance</NameLast> </TransactionFeeDetail> <TransactionFeeDetail> <FeeDetailID>1624281693</FeeDetailID> <FeeDetailFeeCode>CRTCOSTS</FeeDetailFeeCode> <FeeDetailFeeCodeText>Court Costs</FeeDetailFeeCodeText> <ChargeAmount>0.0000</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>0.0000</DisbursementAmount> <PaymentAmount>2.7700</PaymentAmount> <RecipientAccountID>1610014856</RecipientAccountID> <NameLast>MN Department of Finance</NameLast> </TransactionFeeDetail> </Transaction> <Transaction> <TransactionID>1621746487</TransactionID> <TransactionTypeText>Disbursement</TransactionTypeText> <TransactionDate>2010-09-01T00:00:00</TransactionDate> <TransactionFeeDetail> <FeeDetailID>1624242664</FeeDetailID> <FeeDetailFeeCode>MUNICCTY</FeeDetailFeeCode> <FeeDetailFeeCodeText>Municipal Fines-County Share</FeeDetailFeeCodeText> <ChargeAmount>0.0000</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>32.2800</DisbursementAmount> <PaymentAmount>0.0000</PaymentAmount> <RecipientAccountID>1610014856</RecipientAccountID> <NameLast>MN Department of Finance</NameLast> </TransactionFeeDetail> <TransactionFeeDetail> <FeeDetailID>1624242665</FeeDetailID> <FeeDetailFeeCode>10CHAS23</FeeDetailFeeCode> <FeeDetailFeeCodeText>Chaska (0300) 2/3</FeeDetailFeeCodeText> <ChargeAmount>0.0000</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>64.5400</DisbursementAmount> <PaymentAmount>0.0000</PaymentAmount> <RecipientAccountID>1610014856</RecipientAccountID> <NameLast>MN Department of Finance</NameLast> </TransactionFeeDetail> <TransactionFeeDetail> <FeeDetailID>1624242666</FeeDetailID> <FeeDetailFeeCode>CRTCOSTS</FeeDetailFeeCode> <FeeDetailFeeCodeText>Court Costs</FeeDetailFeeCodeText> <ChargeAmount>0.0000</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>0.4100</DisbursementAmount> <PaymentAmount>0.0000</PaymentAmount> <RecipientAccountID>1610014856</RecipientAccountID> <NameLast>MN Department of Finance</NameLast> </TransactionFeeDetail> <TransactionFeeDetail> <FeeDetailID>1624281693</FeeDetailID> <FeeDetailFeeCode>CRTCOSTS</FeeDetailFeeCode> <FeeDetailFeeCodeText>Court Costs</FeeDetailFeeCodeText> <ChargeAmount>0.0000</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>2.7700</DisbursementAmount> <PaymentAmount>0.0000</PaymentAmount> <RecipientAccountID>1610014856</RecipientAccountID> <NameLast>MN Department of Finance</NameLast> </TransactionFeeDetail> </Transaction> <Transaction> <TransactionID>1639560336</TransactionID> <TransactionTypeText>Charge</TransactionTypeText> <TransactionDate>2016-07-11T00:00:00</TransactionDate> <TransactionFeeDetail> <FeeDetailID>1650110685</FeeDetailID> <FeeDetailFeeCode>REST</FeeDetailFeeCode> <FeeDetailFeeCodeText>Restitution</FeeDetailFeeCodeText> <ChargeAmount>500.0000</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>0.0000</DisbursementAmount> <PaymentAmount>0.0000</PaymentAmount> </TransactionFeeDetail> </Transaction> <Transaction> <TransactionID>1639560337</TransactionID> <TransactionCommentText>Testing</TransactionCommentText> <TransactionTypeText>Adjustment</TransactionTypeText> <TransactionDate>2016-07-11T00:00:00</TransactionDate> <TransactionFeeDetail> <FeeDetailID>1650110685</FeeDetailID> <FeeDetailFeeCode>REST</FeeDetailFeeCode> <FeeDetailFeeCodeText>Restitution</FeeDetailFeeCodeText> <ChargeAmount>-500.0000</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>0.0000</DisbursementAmount> <PaymentAmount>0.0000</PaymentAmount> </TransactionFeeDetail> </Transaction> </FinancialDetail> </Integration>
  8. How do I get output for required elements

    Hello Foxy Mod, You are right. However I am not sure how to add more code so that for example the code handles all TransactionTypeText other than the 4 being handled currently. E.g <TransactionTypeText>Adjustment</TransactionTypeText> is generating an error.
  9. My xslt code is returning correct output when TransactionTypeText='Charge', TransactionTypeText='Payment', TransactionTypeText='Credit', and TransactionTypeText='Disbursement'. However if the xml document has TransactionTypeText that is other than these 4, I am getting an error. For example, when TransactionTypeText='Adjustment', I am getting an error Unknown transaction type. Adjustment. I would like to add code so I also get the output when TransactionTypeText is other than Charge, Payment, Credit or Disbursement. When the TranscationTypeText is not any of the 4, I would like to get the amounts from any of the source columns from the xml document. For each row, only one of the sourse columns should have a non-zero value. If a row has more than one non-zero source columns, I return an exception which is in my xslt stylesheet How do I modify my xslt code to handle all TransactionTypeText=xyz? Here is my output for xml document without Adjustment element. This is correct or expected output <FinancialDetail> <FinancialTransaction> <TransactionID>1639560336</TransactionID> <TransactionTypeText>Charge</TransactionTypeText> <TransactionDate>2016-07-11</TransactionDate> <TransactionFeeDetail> <FeeDetailID>1650110685</FeeDetailID> <FeeDetailFeeCodeText code="REST">Restitution</FeeDetailFeeCodeText> <FeeDetailFeeAmount>500</FeeDetailFeeAmount> </TransactionFeeDetail> <TransactionCommentText/> <TransactionPaymentCreditTypeText/> </FinancialTransaction> </FinancialDetail> xslt code <xsl:stylesheet version="1.0" xmlns="http://www.courts.state.mn.us/CourtXML/3" xmlns:msc="http://www.courts.state.mn.us/CourtXML/3" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:mscef="courts.state.mn.us/extfun" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="mscef msxsl msc"> <xsl:output method="xml" encoding="UTF-8"/> <xsl:template name="FinancialDetailType"> <xsl:for-each select="ancestor::Integration/FinancialDetail/Transaction[count(TransactionFeeDetail[FeeDetailFeeCode='REST'])>0]"> <FinancialTransaction> <TransactionID> <xsl:value-of select="TransactionID"/> </TransactionID> <TransactionTypeText> <xsl:value-of select="TransactionTypeText"/> </TransactionTypeText> <TransactionDate> <xsl:value-of select="substring(TransactionDate,1,10)"/> </TransactionDate> <xsl:for-each select="TransactionFeeDetail[FeeDetailFeeCode='REST']"> <TransactionFeeDetail> <FeeDetailID> <xsl:value-of select="FeeDetailID"/> </FeeDetailID> <FeeDetailFeeCodeText> <xsl:attribute name="code"> <xsl:value-of select="FeeDetailFeeCode"/> </xsl:attribute> <xsl:value-of select="FeeDetailFeeCodeText"/> </FeeDetailFeeCodeText> <FeeDetailFeeAmount> <xsl:choose> <xsl:when test="../TransactionTypeText='Charge'"> <xsl:value-of select="mscef:formatCurrency(string(ChargeAmount))"/> </xsl:when> <xsl:when test="../TransactionTypeText='Payment'"> <xsl:value-of select="mscef:formatCurrency(string(PaymentAmount))"/> </xsl:when> <xsl:when test="../TransactionTypeText='Credit'"> <xsl:value-of select="mscef:formatCurrency(string(CreditAmount))"/> </xsl:when> <xsl:when test="../TransactionTypeText='Disbursement'"> <xsl:value-of select="mscef:formatCurrency(string(DisbursementAmount))"/> </xsl:when> <xsl:otherwise> <xsl:message terminate="yes">Unknown transaction type. <xsl:value-of select="../TransactionTypeText"/> </xsl:message> </xsl:otherwise> </xsl:choose> </FeeDetailFeeAmount> </TransactionFeeDetail> </xsl:for-each> <TransactionCommentText> <xsl:value-of select="TransactionCommentText"/> </TransactionCommentText> <TransactionPaymentCreditTypeText> <xsl:value-of select="TransactionPaymentCreditTypeText"/> </TransactionPaymentCreditTypeText> </FinancialTransaction> </xsl:for-each> </xsl:template> <msxsl:script language="JScript" implements-prefix="mscef"> <![CDATA[ function formatCurrency(asCurrency){ asCurrency = asCurrency.replace("\$",""); asCurrency = asCurrency.replace("\,",""); return parseFloat(asCurrency); } function formatTwoDecimalCurrency(asCurrency){ if(asCurrency.length==0){ return ""; } asCurrency = asCurrency.replace("\$",""); asCurrency = asCurrency.replace("\,",""); return parseFloat(asCurrency).toFixed(2); } ]]></msxsl:script> </xsl:stylesheet> My xml document <?xml version="1.0" encoding="UTF-8"?> <Pipeline xmlns=""> <SourceXML> <Integration> <Case InternalID="1612988653" ID="5226206" xmlns:user="http://tylertechnologies.com"> </Case> <FinancialDetail> <Transaction> <TransactionID>1621246445</TransactionID> <TransactionTypeText>Charge</TransactionTypeText> <TransactionDate>2010-06-30T00:00:00</TransactionDate> <TransactionFeeDetail> <FeeDetailID>1624242662</FeeDetailID> <FeeDetailFeeCode>CRMTRAF5</FeeDetailFeeCode> <FeeDetailFeeCodeText>Crim/Traffic Surcharge 2005</FeeDetailFeeCodeText> <ChargeAmount>72.0000</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>0.0000</DisbursementAmount> <PaymentAmount>0.0000</PaymentAmount> <RecipientAccountID>1610014856</RecipientAccountID> <NameLast>MN Department of Finance</NameLast> </TransactionFeeDetail> <TransactionFeeDetail> <FeeDetailID>1624242663</FeeDetailID> <FeeDetailFeeCode>LAWLIBCR</FeeDetailFeeCode> <FeeDetailFeeCodeText>Law Library Criminal</FeeDetailFeeCodeText> <ChargeAmount>10.0000</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>0.0000</DisbursementAmount> <PaymentAmount>0.0000</PaymentAmount> <RecipientAccountID>1610014856</RecipientAccountID> <NameLast>MN Department of Finance</NameLast> </TransactionFeeDetail> <TransactionFeeDetail> <FeeDetailID>1624242664</FeeDetailID> <FeeDetailFeeCode>MUNICCTY</FeeDetailFeeCode> <FeeDetailFeeCodeText>Municipal Fines-County Share</FeeDetailFeeCodeText> <ChargeAmount>233.3800</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>0.0000</DisbursementAmount> <PaymentAmount>0.0000</PaymentAmount> <RecipientAccountID>1610014856</RecipientAccountID> <NameLast>MN Department of Finance</NameLast> </TransactionFeeDetail> <TransactionFeeDetail> <FeeDetailID>1624242665</FeeDetailID> <FeeDetailFeeCode>10CHAS23</FeeDetailFeeCode> <FeeDetailFeeCodeText>Chaska (0300) 2/3</FeeDetailFeeCodeText> <ChargeAmount>466.6200</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>0.0000</DisbursementAmount> <PaymentAmount>0.0000</PaymentAmount> <RecipientAccountID>1610014856</RecipientAccountID> <NameLast>MN Department of Finance</NameLast> </TransactionFeeDetail> <TransactionFeeDetail> <FeeDetailID>1624242666</FeeDetailID> <FeeDetailFeeCode>CRTCOSTS</FeeDetailFeeCode> <FeeDetailFeeCodeText>Court Costs</FeeDetailFeeCodeText> <ChargeAmount>3.0000</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>0.0000</DisbursementAmount> <PaymentAmount>0.0000</PaymentAmount> <RecipientAccountID>1610014856</RecipientAccountID> <NameLast>MN Department of Finance</NameLast> </TransactionFeeDetail> <TransactionFeeDetail> <FeeDetailID>1624242667</FeeDetailID> <FeeDetailFeeCode>PROSCOSTS</FeeDetailFeeCode> <FeeDetailFeeCodeText>Prosecution Costs</FeeDetailFeeCodeText> <ChargeAmount>700.0000</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>0.0000</DisbursementAmount> <PaymentAmount>0.0000</PaymentAmount> <RecipientAccountID>1610014856</RecipientAccountID> <NameLast>MN Department of Finance</NameLast> </TransactionFeeDetail> </Transaction> <Transaction> <TransactionID>1621279946</TransactionID> <TransactionTypeText>Charge</TransactionTypeText> <TransactionDate>2010-07-06T00:00:00</TransactionDate> <TransactionFeeDetail> <FeeDetailID>1624281693</FeeDetailID> <FeeDetailFeeCode>CRTCOSTS</FeeDetailFeeCode> <FeeDetailFeeCodeText>Court Costs</FeeDetailFeeCodeText> <ChargeAmount>20.0000</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>0.0000</DisbursementAmount> <PaymentAmount>0.0000</PaymentAmount> <RecipientAccountID>1610014856</RecipientAccountID> <NameLast>MN Department of Finance</NameLast> </TransactionFeeDetail> </Transaction> <Transaction> <TransactionID>1621541452</TransactionID> <TransactionTypeText>Payment</TransactionTypeText> <TransactionDate>2010-08-06T00:00:00</TransactionDate> <TransactionFeeDetail> <FeeDetailID>1624242664</FeeDetailID> <FeeDetailFeeCode>MUNICCTY</FeeDetailFeeCode> <FeeDetailFeeCodeText>Municipal Fines-County Share</FeeDetailFeeCodeText> <ChargeAmount>0.0000</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>0.0000</DisbursementAmount> <PaymentAmount>32.2800</PaymentAmount> <RecipientAccountID>1610014856</RecipientAccountID> <NameLast>MN Department of Finance</NameLast> </TransactionFeeDetail> <TransactionFeeDetail> <FeeDetailID>1624242665</FeeDetailID> <FeeDetailFeeCode>10CHAS23</FeeDetailFeeCode> <FeeDetailFeeCodeText>Chaska (0300) 2/3</FeeDetailFeeCodeText> <ChargeAmount>0.0000</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>0.0000</DisbursementAmount> <PaymentAmount>64.5400</PaymentAmount> <RecipientAccountID>1610014856</RecipientAccountID> <NameLast>MN Department of Finance</NameLast> </TransactionFeeDetail> <TransactionFeeDetail> <FeeDetailID>1624242666</FeeDetailID> <FeeDetailFeeCode>CRTCOSTS</FeeDetailFeeCode> <FeeDetailFeeCodeText>Court Costs</FeeDetailFeeCodeText> <ChargeAmount>0.0000</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>0.0000</DisbursementAmount> <PaymentAmount>0.4100</PaymentAmount> <RecipientAccountID>1610014856</RecipientAccountID> <NameLast>MN Department of Finance</NameLast> </TransactionFeeDetail> <TransactionFeeDetail> <FeeDetailID>1624281693</FeeDetailID> <FeeDetailFeeCode>CRTCOSTS</FeeDetailFeeCode> <FeeDetailFeeCodeText>Court Costs</FeeDetailFeeCodeText> <ChargeAmount>0.0000</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>0.0000</DisbursementAmount> <PaymentAmount>2.7700</PaymentAmount> <RecipientAccountID>1610014856</RecipientAccountID> <NameLast>MN Department of Finance</NameLast> </TransactionFeeDetail> </Transaction> <Transaction> <TransactionID>1621746487</TransactionID> <TransactionTypeText>Disbursement</TransactionTypeText> <TransactionDate>2010-09-01T00:00:00</TransactionDate> <TransactionFeeDetail> <FeeDetailID>1624242664</FeeDetailID> <FeeDetailFeeCode>MUNICCTY</FeeDetailFeeCode> <FeeDetailFeeCodeText>Municipal Fines-County Share</FeeDetailFeeCodeText> <ChargeAmount>0.0000</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>32.2800</DisbursementAmount> <PaymentAmount>0.0000</PaymentAmount> <RecipientAccountID>1610014856</RecipientAccountID> <NameLast>MN Department of Finance</NameLast> </TransactionFeeDetail> <TransactionFeeDetail> <FeeDetailID>1624242665</FeeDetailID> <FeeDetailFeeCode>10CHAS23</FeeDetailFeeCode> <FeeDetailFeeCodeText>Chaska (0300) 2/3</FeeDetailFeeCodeText> <ChargeAmount>0.0000</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>64.5400</DisbursementAmount> <PaymentAmount>0.0000</PaymentAmount> <RecipientAccountID>1610014856</RecipientAccountID> <NameLast>MN Department of Finance</NameLast> </TransactionFeeDetail> <TransactionFeeDetail> <FeeDetailID>1624242666</FeeDetailID> <FeeDetailFeeCode>CRTCOSTS</FeeDetailFeeCode> <FeeDetailFeeCodeText>Court Costs</FeeDetailFeeCodeText> <ChargeAmount>0.0000</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>0.4100</DisbursementAmount> <PaymentAmount>0.0000</PaymentAmount> <RecipientAccountID>1610014856</RecipientAccountID> <NameLast>MN Department of Finance</NameLast> </TransactionFeeDetail> <TransactionFeeDetail> <FeeDetailID>1624281693</FeeDetailID> <FeeDetailFeeCode>CRTCOSTS</FeeDetailFeeCode> <FeeDetailFeeCodeText>Court Costs</FeeDetailFeeCodeText> <ChargeAmount>0.0000</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>2.7700</DisbursementAmount> <PaymentAmount>0.0000</PaymentAmount> <RecipientAccountID>1610014856</RecipientAccountID> <NameLast>MN Department of Finance</NameLast> </TransactionFeeDetail> </Transaction> <Transaction> <TransactionID>1639560336</TransactionID> <TransactionTypeText>Charge</TransactionTypeText> <TransactionDate>2016-07-11T00:00:00</TransactionDate> <TransactionFeeDetail> <FeeDetailID>1650110685</FeeDetailID> <FeeDetailFeeCode>REST</FeeDetailFeeCode> <FeeDetailFeeCodeText>Restitution</FeeDetailFeeCodeText> <ChargeAmount>500.0000</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>0.0000</DisbursementAmount> <PaymentAmount>0.0000</PaymentAmount> </TransactionFeeDetail> </Transaction> <Transaction> <TransactionID>1639560337</TransactionID> <TransactionCommentText>Testing</TransactionCommentText> <TransactionTypeText>Adjustment</TransactionTypeText> <TransactionDate>2016-07-11T00:00:00</TransactionDate> <TransactionFeeDetail> <FeeDetailID>1650110685</FeeDetailID> <FeeDetailFeeCode>REST</FeeDetailFeeCode> <FeeDetailFeeCodeText>Restitution</FeeDetailFeeCodeText> <ChargeAmount>-500.0000</ChargeAmount> <CreditAmount>0.0000</CreditAmount> <DisbursementAmount>0.0000</DisbursementAmount> <PaymentAmount>0.0000</PaymentAmount> </TransactionFeeDetail> </Transaction> </FinancialDetail> </Integration> </SourceXML> <CourtXML/> <CaseOptions xmlns="http://www.courts.state.mn.us/CourtXML/3"> <FinancialSummary> <SelectedIndicator>true</SelectedIndicator> </FinancialSummary> <FinancialDetail> <SelectedIndicator>true</SelectedIndicator> </FinancialDetail> </CaseOptions> </Pipeline>
  10. I have revised my question. I would like to get the Status whose TimstampCreate matches (or closely) ControlPoint Timestamp. How do I do this with my xslt code? My xml code <?xml version="1.0" encoding="UTF-8"?> <Integration> <ControlPoint Timestamp="5/9/2016 2:34:34 PM" UserID="kuku">SAVE</ControlPoint> <ProtectionOrders> <ProtectionOrder Op="E"> <Statuses> <Status> <Date>05/09/2016</Date> <Type Word="DIS">Dismissed</Type> <TimeStampCreate>05/09/2016 14:34:48:633</TimestampCreate> </Status> <Status Op="A"> <Date Op="A">05/09/2016</Date> <Type Op="A" Word="SBJ">Signed</Type> <TimestampCreate>05/09/2016 14:34:34:737</TimestampCreate> </Status> </Statuses> </ProtectionOrder> </Integration> Expected Output something similar to this: <Statuses> <Status Op="A"> <Current>false</Current> <Date Op="A">05/09/2016</Date> <Type Op="A" Word="SBJ">Signed</Type> <TimestampCreate>20160509143434</TimestampCreate> </Status> </Statuses> I have a function to convert date time to numeric. Here is the function <xsl:value-of select=mscef:formatDateTimeNumeric(mscef:fixOdysseyTimestamp(string(TimeStampCreate)))"/> My xslt 1.0 code <xsl:value-of select="/Integration/ProtectionOrder/Statuses/Status/Date"/>
  11. I have a xml 1.0 document with 3 JudgmentEvent. What I would like to get as output is 1. JudgmentEvent whose parent have not been deleted. 2. JudgmentEvent that have no parent and they have not been deleted. I do not know how to do this? My output should look like this: <JudgmentEvent ID="207217600"> <JudgmentEventType>Judgment - not all parties</JudgmentEventType> <Judgment ID="3928438"/> </JudgmentEvent> <JudgmentEvent ID="207218513"> <JudgmentEventType>Adopted</JudgmentEventType> <Judgment ID="3928452"/> </JudgmentEvent> xml 1.0 code <?xml version="1.0" encoding="UTF-8"?> <Case> <JudgmentEvent InternalID="1810327075" ID="207217512" Date="05/24/2016"> <JudgmentEventType InternalID="51314" Word="JDGMULT">Judgment - not all parties</JudgmentEventType> <IssueDate>05/24/2016</IssueDate> <TimestampCreate>05/24/2016 09:32:50:837</TimestampCreate> <TimestampChange>05/24/2016 11:34:15</TimestampChange> <Deleted>true</Deleted> <AmendReason InternalID="11091" Word="CTORDER">Court Order</AmendReason> <Judgment ID="3928437" InternalID="1613120225"/> <JudgmentEvent InternalID="1810327074" ID="207217511" Date="05/24/2016"> <JudgmentEventType InternalID="13024" Word="JUDGGR">Judgment</JudgmentEventType> <IssueDate>05/24/2016</IssueDate> <AgingClockActionKey Word="SP">Stops case aging clock</AgingClockActionKey> <TimestampCreate>05/24/2016 09:32:24:447</TimestampCreate> <TimestampChange>05/24/2016 11:51:29</TimestampChange> <Deleted>false</Deleted> <Judgment ID="3928436" InternalID="1613120224"/> </JudgmentEvent> </JudgmentEvent> <JudgmentEvent InternalID="1810327167" ID="207217600" Date="05/24/2016"> <JudgmentEventType InternalID="51314" Word="JDGMULT">Judgment - not all parties</JudgmentEventType> <IssueDate>05/24/2016</IssueDate> <TimestampCreate>05/24/2016 11:51:29:377</TimestampCreate> <Deleted>false</Deleted> <AmendReason InternalID="11091" Word="CTORDER">Court Order</AmendReason> <Judgment ID="3928438" InternalID="1613120226"/> <JudgmentEvent InternalID="1810327074" ID="207217511" Date="05/24/2016"> <JudgmentEventType InternalID="13024" Word="JUDGGR">Judgment</JudgmentEventType> <IssueDate>05/24/2016</IssueDate> <TimestampCreate>05/24/2016 09:32:24:447</TimestampCreate> <TimestampChange>05/24/2016 11:51:29</TimestampChange> <Deleted>false</Deleted> <RecordingNeeded>false</RecordingNeeded> <Judgment ID="3928436" InternalID="1613120224"/> </JudgmentEvent> </JudgmentEvent> <JudgmentEvent InternalID="1810327321" ID="207218513" Date="05/25/2016"> <JudgmentEventType InternalID="12997" Word="ADOPT">Adopted</JudgmentEventType> <IssueDate>05/25/2016</IssueDate> <TimestampCreate>05/25/2016 10:35:01:210</TimestampCreate> <Deleted>false</Deleted> <Judgment ID="3928452" InternalID="1613120240"/> </JudgmentEvent> </Case>
  12. I have a xml document that I would like to display **Number** from <CrossReferenceNumber> elemen. In my xslt the **Number** is inside <ext:SupersededProtectionOrderID> element. Desired output <ext:SupersededProtectionOrderID>OFP System Number</ext:SupersededProtectionOrderID> Here are the conditions: Condition one If ProtectionOrder/CrossReferenceNumbers/CrossReferenceNumber/Type = ‘OFP System Number’ and ProtectionOrders/ProtectionOrder/Statuses/Status/Type = Signed By Judicial Officer has an Op = “A” Condition two If ProtectionOrder/CrossReferenceNumbers/CrossReferenceNumber/Type = ‘OFP System Number’ and ProtectionOrders/ProtectionOrder/Statuses/Status/Type = ‘Signed By Judicial Officer – Corrected’ and has Op = ‘A’ display ProtectionOrder/CrossReferenceNumbers/CrossReferenceNumber/Number My xml <Integration xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:tsg="http://tsgweb.com" xmlns:IXML="http://tsgweb.com" xmlns:CMCodeQueryHelper="urn:CMCodeQueryHelper" PackageID="BCA PO Notification" MessageID="67177928" xmlns=""> <ProtectionOrders> <ProtectionOrder Op="E" InternalProtectionOrderID="932"> <ProtectionOrderNumber>201500845</ProtectionOrderNumber> <Type Word="OFP">Order for Protection</Type> <Statuses> <Status Op="A"> <Current>true</Current> <Active>Yes</Active> <Date Op="A">09/01/2015</Date> <Type Op="A" Word="SBJO">Signed By Judicial Officer</Type> <TimestampCreate Op="A">09/01/2015 12:39:49:763</TimestampCreate> </Status> <Status> <Current>false</Current> <Active>No</Active> <Date>09/01/2015</Date> <Type Word="DRAFT">Draft</Type> <TimestampCreate>09/01/2015 12:39:43:207</TimestampCreate> </Status> </Statuses> <CrossReferenceNumbers> <CrossReferenceNumber> <Type Word="NCICNUM">NCIC Number</Type> <Number>Testing123</Number> </CrossReferenceNumber> </CrossReferenceNumbers> <TimestampCreate>09/01/2015 12:39:43:140</TimestampCreate> <TimestampChange>09/01/2015 12:39:49:750</TimestampChange> </ProtectionOrder> </ProtectionOrders> </Case> <ProtectionOrder Op="E" InternalProtectionOrderID="932" xmlns:user="http://tylertechnologies.com"> <ProtectionOrderNumber>201500845</ProtectionOrderNumber> <Type Word="OFP">Order for Protection</Type> <Statuses> <Status Op="A"> <Current>true</Current> <Active>Yes</Active> <Date Op="A">09/01/2015</Date> <Type Op="A" Word="SBJO">Signed By Judicial Officer</Type> <TimestampCreate Op="A">09/01/2015 12:39:49:763</TimestampCreate> </Status> <Status> <Current>false</Current> <Active>No</Active> <Date>09/01/2015</Date> <Type Word="DRAFT">Draft</Type> <TimestampCreate>09/01/2015 12:39:43:207</TimestampCreate> </Status> </Statuses> <CrossReferenceNumbers> <CrossReferenceNumber> <Type Word="NCICNUM">OFP System Number</Type> <Number>Testing123</Number> </CrossReferenceNumber> </CrossReferenceNumbers> </ProtectionOrder> My xslt code <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:exc="http://www.courts.state.mn.us/ProtectionOrderServiceExchange/1.0" xmlns:ext="http://www.courts.state.mn.us/ProtectionOrderExtension/1.0"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template name="ProtectionOrder"> <!--SupersededProtectionOrderID--> <ext:SupersededProtectionOrderID> <xsl:choose> <xsl:when test="(Statuses/Status/Type/@Op='A') and count(CrossReferenceNumbers/CrossReferenceNumber/Type='OFP System Number')>0"> <xsl:value-of select="Number"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="/Integration/ProtectionOrder[@InternalProtectionOrderID=current()/MNProtectionOrderAdditional/@SupersededProtectionOrderID]/ProtectionOrderNumber"/> </xsl:otherwise> </xsl:choose> </ext:SupersededProtectionOrderID> </xsl:template> </xsl:stylesheet>
  13. Here is my sample xml document with 2 Charges. Each Charge has a child element (Vehicle) which has the CommercialVehicleFlag. Sometimes a xml document may have under Integration, a Citation which will have CommercialVehicleFlag (xpath) /Integration/Citation/CommercialVehicleFlag). or for this particular xml document /Integration/Charge/Vehicle/CommercialVehicleFlag. For that reason I need to check CommercialVehicleFlag from tow different places (xpaths) so as to display them based on where they are located. Either under Citation or under Charge. Desired output <Charge ID="10905889"> <Vehicle> <CommercialVehicleFlag>false</CommercialVehicleFlag> </Vehicle> </Charge> <Charge ID="10905890"> <Vehicle> <CommercialVehicleFlag>true</CommercialVehicleFlag> </Vehicle> </Charge> My sample xml document. Sometimes a document may have Citation with Vehicle and CommercialVehicleIndicator. The xml document will never have both Citation and Charge at the same time. <Integration xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:tsg="http://tsgweb.com" xmlns:IXML="http://tsgweb.com" xmlns:CMCodeQueryHelper="urn:CMCodeQueryHelper" PackageID="DL Notice to DVS" MessageID="67084403" xmlns=""> <Case Op="E" InternalID="1617090273" ID="12124494" xmlns:user="http://tylertechnologies.com"> <Charge ID="10905889"> <Vehicle> <CommercialVehicleFlag>false</CommercialVehicleFlag> </Vehicle> </Charge> <Charge ID="10905890"> <Vehicle> <CommercialVehicleFlag>true</CommercialVehicleFlag> </Vehicle> </Charge> </Case></Integration> My xsl line of code which is returning false for both Integration/Case/Charge/Vehicle/CommercialVehicleFlag and Integration/Citation/Vehicle/CommercialVehicleFlag My xsl line of code <xsl:value-of select="(/Integration/Citation/Vehicle[CommercialVehicleFlag]|/Integration/Case/Charge/Vehicle[CommercialVehicleFlag])[1]/CommercialVehicleFlag"/>
  14. How do I get the most recent HearingDate?

    I resolved this one...... <xsl:for-each select="Hearing/Setting[not(Cancelled)]"> <xsl:sort select="HearingDate" order="descending"/> <xsl:if test="position() = 1"> <xsl:value-of select="mscef:formatDate(string(HearingDate))"/> </xsl:if> </xsl:for-each>
  15. What I want to do is...to determining Hearing Date. I want to evaluate the Hearing records in the xml document. If more than one Hearing ID is found, use the most recent HearingDate that has passed. Skip records where SettingID/Cancelled = “True” If multiple hearings are on a case the most recent hearing date should be selected to populate the outbound message. How do I do this? xml document <Integration xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:tsg="http://tsgweb.com" xmlns:IXML="http://tsgweb.com" xmlns:CMCodeQueryHelper="urn:CMCodeQueryHelper" PackageID="DL Notice to DVS" MessageID="67086844" xmlns=""> <Case InternalID="1616832909" ID="11783147" xmlns:user="http://tylertechnologies.com"> <Hearing ID="153546512" InternalHearingEventID="1716143353"> <Setting ID="23490064" InternalSettingID="1623782066" Date="05/14/2014">--> <HearingDate>01/01/2014</HearingDate> </Setting> </Hearing> <Hearing ID="155794813" InternalHearingEventID="1717919318"> <Setting ID="23727431" InternalSettingID="1623950282" Date="07/09/2014"> <HearingDate>07/09/2014</HearingDate> </Setting> </Hearing> <Hearing ID="158501312" InternalHearingEventID="1720225032"> <Setting ID="24032349" Cancelled="true" InternalSettingID="1624178189" Date="07/11/2014"> <HearingDate>07/11/2014</HearingDate> </Setting> </Hearing> <Hearing ID="158551556" InternalHearingEventID="1720240342"> <Setting ID="24040436" InternalSettingID="1624179819" Date="08/20/2014"> <HearingDate>08/20/2014</HearingDate> </Setting> </Hearing> </Case></Integration> My xsl line of code to get the HearingDate. I need to check for hearing and select the most recent HearingDate which do not have Hearing/Setting/@Cancelled="true" <xsl:value-of select="mscef:formatDate(string(Hearing/Setting[not(@Cancelled)]/HearingDate))"/>
×