Jump to content
winkimjr2

How do I check if the first StartTime exist and then use it otherwise use the other one in CourseSessionBlock?

Recommended Posts

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>

Share this post


Link to post
Share on other sites

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>
.... There are many ways. This is a simple Boolean solution. It all depend on what you would like to use to solve this. What language are you more comfortable with? What all language do you know?

Share this post


Link to post
Share on other sites

I am using xml and xslt to transform it. So what do you think I should do? I know I need to check to see if StartTime after the HearingDate is present, if it is I will use it. If it does not exist I will then use the StartTime the child of CourtSessionBlock. But I do not know how to do this.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...