Jump to content

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


winkimjr2

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>
Link to comment
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?
Link to comment
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.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...