Jump to content

winkimjr2

Members
  • Posts

    42
  • Joined

  • Last visited

Posts posted by winkimjr2

  1. What I am trying to do is get the ChargeID=10485838. To get this ChargeID, I need to look in the ChargeHistory element for the Stage="Plea Event" and find the PleaEventSequence value with the highest event number (for example PleaEventSequence="2") and then find the Plea in the PleaEvent node whose ChargeHistoryID matches the Charge node's ChargeHistoryID . In my case this would be ChargeHistoryID="41274044"
    How do I do this?

     

    I have attached my xml code because it is too long.

    See attached file

    Here is my xslt template 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"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template match="/"> <xsl:variable name="vPleaEventID"> <xsl:call-template name="GetChargePleaEventID"> <xsl:with-param name="pChargeID"></xsl:with-param> </xsl:call-template> </xsl:variable> <result> <xsl:value-of select="$vPleaEventID"/> </result> </xsl:template> <!-- --> <xsl:template name="GetChargePleaEventID"> <xsl:param name="pChargeID"/> <xsl:value-of select="$pChargeID"/> </xsl:template></xsl:stylesheet>

    testcase.xml

  2. I would like to display the word false instead of an empty string "" for the

    <ext:AddressReference ext:currentIndicator="">

    How do I do this?

     

    My output which is wrong

    <ext:AddressReference ext:currentIndicator="true">    <nc:LocationReference s:ref="INT10566286"/></ext:AddressReference><ext:AddressReference ext:currentIndicator="">    <nc:LocationReference s:ref="INT4279606"/></ext:AddressReference>

    Desired output adds the word false to the empty string

    <ext:AddressReference ext:currentIndicator="true">    <nc:LocationReference s:ref="INT10566286"/></ext:AddressReference><ext:AddressReference ext:currentIndicator="false">    <nc:LocationReference s:ref="INT4279606"/></ext:AddressReference>

    My xml code

    <Address PartyCorrespondence="true" PartyCurrent="true" ID="10566286" Type="Standard">    <AddressLine2>772 Minnesota AVE</AddressLine2>    <AddressLine4>Big Lake, MN, 55309</AddressLine4>    <Street>Minnesota</Street>    <City>Big Lake</City>    <State>MN</State>    <Zip>55309</Zip></Address><Address ID="4279606" Type="Non Standard">    <AddressLine1>8435 OAK LANE</AddressLine1>    <AddressLine4>BECKER, MN, 55308</AddressLine4>    <City>BECKER</City>    <State>MN</State>    <Zip>55308</Zip></Address>

    My xslt code

    <xsl:for-each select="Address">    <ext:AddressReference>        <xsl:attribute name="ext:currentIndicator"><xsl:value-of select="@PartyCurrent"/></xsl:attribute>   <nc:LocationReference>       <xsl:attribute name="s:ref"><xsl:text>INT</xsl:text><xsl:value-of select="@ID"/></xsl:attribute>   </nc:LocationReference>    </ext:AddressReference></xsl:for-each>
  3. I have a xml document with respondent HeightFeet element which is 5. When I apply my xslt the HeightFeet is not displayed. Other elements are displayed. What do I need to change. I have posted my xml doc and xslt code which is using a template for the respondent.

     

     

    My xml code

    Removed it because no body here helps
    
    
    						
  4.  

    I have XML address and want the result to be one line like this:123 E Rubble ALY E, Bedrock, DC, 65401How do I do it in XSLT?XML Address Elements

    <Address InternalAddressID="1618207867" Type="Standard">   <Location Word="HOME">Home</Location>   <AddressLine2>123 E Rubble ALY E</AddressLine2>   <AddressLine4>Bedrock, DC, 65401</AddressLine4>   <Block>123</Block>   <PreDir Word="E">East</PreDir>   <Street>Rubble</Street>   <AddrSfxKy Word="ALY">Alley</AddrSfxKy>   <PostDir Word="E">East</PostDir>   <City>Bedrock</City>   <State>DC</State>   <Zip>65401</Zip></Address>

    Done

  5. I have XML address and want the result to be one line like this:123 E Rubble ALY E, Bedrock, DC, 65401How do I do it in XSLT?XML Address Elements

    <Address InternalAddressID="1618207867" Type="Standard">   <Location Word="HOME">Home</Location>   <AddressLine2>123 E Rubble ALY E</AddressLine2>   <AddressLine4>Bedrock, DC, 65401</AddressLine4>   <Block>123</Block>   <PreDir Word="E">East</PreDir>   <Street>Rubble</Street>   <AddrSfxKy Word="ALY">Alley</AddrSfxKy>   <PostDir Word="E">East</PostDir>   <City>Bedrock</City>   <State>DC</State>   <Zip>65401</Zip></Address>
  6. It's been a while since I last worked with XSL but this is probably similar to what you want:

    <xsl:choose>    <xsl:when test="MyID='DC19DAKHN'">        <MyID>MN019015J</MyID>    </xsl:when>    <xsl:when test="MyID='DC19D0000'">        <MyID>MN019015J</MyID>    </xsl:when>    <xsl:otherwise>        <MyID><xsl:value-of select="MyID"/></MyID>    </xsl:otherwise></xsl:choose>

     

    I think you need more information to be able to help me. When the enforcement agency ID is DC19D0000 this will be changed to MN019015J. However, the last 4 digits will be stripped and instead add 4 0s, so the output will show MN0190000.Here is my template xsl code<!--Template to produce service--><EnforcementAgency><OrganizationIdentification><nc:IdentificationID><xsl:choose><xsl:when test="/Integration/Case/Court[CourtNCIC=DC19D0000]"><xsl:text>MN019015J</xsl:text></xsl:when><xsl:otherwise><xsl:value-of select="substring(//Integration/Case/Court/CourtNCIC,1,5)"/><xsl:text>0000</xsl:text></xsl:otherwise></xsl:choose></nc:IdentificationID></OrganizationIdentification></EnforcementAgency>Here is my XML document<Court><NodeID>13045</NodeID><CourtNCIC>DC19DAKHN</CourtNCIC></Court>
  7. It'll be something like:

    <xsl:if test="WeightPounds">  <nc:PersonWeightMeasure>   <nc:MeasureText>    <xsl:choose>	<xsl:when test="WeightPounds">          <xsl:value-of select="WeightPounds[. gt 50 or .  lt 499]"/>	</xsl:when>    </xsl:choose>   </nc:MeasureText>   <nc:MeasureUnitText>     <xsl:text>pounds</xsl:text>   </nc:MeasureUnitText>   <nc:WeightUnitCode>     <xsl:text>LBR</xsl:text>   </nc:WeightUnitCode>  </nc:PersonWeightMeasure></xsl:if><!--...--><xsl:if test="HeightFeet">  <nc:PersonHeightMeasure>    <nc:MeasureText>      <xsl:choose>        <xsl:when test="HeightFeet">	  <xsl:value-of select="(HeightFeet[. gt 48 or . lt 95])+HeightInches"/>	</xsl:when>      </xsl:choose></nc:MeasureText>

    Thanks for your input.

  8. I am wondering how to change my xslt code so that it checks if height and weight. I want to check if the weight is less than 50 pounds or greater than 499 pounds then this will not be displayed in the output.
    And for the height I want to check if height is less than 48 inches or greater than 95 inches then this will not be displayed in the output.
    Weight xslt code
    <xsl:if test="WeightPounds">  <nc:PersonWeightMeasure>   <nc:MeasureText>    <xsl:choose>	<xsl:when test="WeightPounds">          <xsl:value-of select="WeightPounds"/>	</xsl:when>    </xsl:choose>   </nc:MeasureText>   <nc:MeasureUnitText>     <xsl:text>pounds</xsl:text>   </nc:MeasureUnitText>   <nc:WeightUnitCode>     <xsl:text>LBR</xsl:text>   </nc:WeightUnitCode>  </nc:PersonWeightMeasure></xsl:if>

    xslt code for height

    <xsl:if test="HeightFeet">  <nc:PersonHeightMeasure>    <nc:MeasureText>      <xsl:choose>        <xsl:when test="HeightFeet">	  <xsl:value-of select="(HeightFeet*12)+HeightInches"/>	</xsl:when>      </xsl:choose></nc:MeasureText>
  9. I have an xml document with a person's height element. I am not sure how to use use xslt to transform this and display in inches.

    For example if a person height is 5 foot 5 inches how do I display 65 inches using xslt? I know I need to multiply feet by 12 and then add the inches. But I am not sure how to do this.Here is my xml height element

    <HeightFeet>5</HeightFeet><HeightInches>5</HeightInches>

    The output I want should be 65 inches.

  10. How do I get this result: <ext:HearingDateTime>07/21/2014 8:30 AM</ext:HearingDateTime>I have xml that have two StartTime and a HearingDate. The two StartTime are the same but one is near the top and the other one is a child of CourtSessionBlock. The first StartTime is not always there which means sometimes the only available StartTime is the child of CourtSessionBlock.For this reason, I need to first check if there is StartTime near the top of xml document. If it is there, I will use that StartTime concatenated with HearingDate. Otherwise if it's not there or when the only StartTime is the child of CourtSessionBlock, I will use that one. I have tried using <xsl:if> and <xsl:choose> but I am not getting anything displayed for the <ext:HearingDateTime/>. Please help.Here is my xml code:

    <Setting ID="21613643" InternalSettingID="1622304543" Date="07/21/2014">	<HearingDate>07/21/2014</HearingDate>	<StartTime>8:30 AM</StartTime>	<EndTime>9:30 AM</EndTime>	<CourtSessionBlock InternalCourtSessionBlockID="1614615037">		<StartTime>8:30 AM</StartTime>		<EndTime>9:30 AM</EndTime>	</CourtSessionBlock>	<TimestampCreate>07/15/2014 09:27:49:607</TimestampCreate></Setting>

    Here is my xslt code that is not displaying anything

    <ext:HearingDateTime>    <xsl:choose>	<xsl:when test="/Integration/Case/Setting/StartTime[1]">          <xsl:value-of select="StartTime"/>	</xsl:when>	<xsl:otherwise>	   <xsl:value-of select="/Integration/Case/Hearing/Setting/CourtSessionBlock/StartTime"/>	</xsl:otherwise>    </xsl:choose></ext:HearingDateTime>
  11. In my xml there are 2 StartTime one near the top and another one which is the child of CourtSessionBlock. Sometimes, there will only be one StartTime which is the child of CourtSessionBlock. This is why I need to check to see if there is StartTime near the top. If it is there then I will use it. If it is not there, then I will use the one in the CourtSessionBlock. How do I do this?Here is my xml code:

    <Setting ID="21613643" InternalSettingID="1622304543" Date="07/21/2014"><HearingDate>07/21/2014</HearingDate><StartTime>8:30 AM</StartTime><EndTime>9:30 AM</EndTime><CourtSessionName>Jackie - Doe</CourtSessionName><CourtSessionID ID="3177494" InternalCourtSessionID="1612374333"/><Calendar Word="05CAL">My County Court</Calendar><CalendarBaseCaseCategory>Probate Health</CalendarBaseCaseCategory><CourtResource><Type Word="JUD">Judicial Officer</Type><Code Word="00951B">Jane, Doe</Code></CourtResource><CourtSessionBlock InternalCourtSessionBlockID="1614615037"><StartTime>8:30 AM</StartTime><EndTime>9:30 AM</EndTime></CourtSessionBlock><InterpreterNeeded>false</InterpreterNeeded><TimestampCreate>07/15/2014 09:27:49:607</TimestampCreate></Setting>
×
×
  • Create New...