How do I check for StartTime (the first one in xml doc) and

Here should go questions about transforming XML with XSLT and FOP.
winkimjr2
Posts: 53

How do I check for StartTime (the first one in xml doc) and

Mon Aug 11, 2014 10:47 pm

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? I tried choose but I am not getting any output.
Here is my xml code:

Code: Select all

<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>
Radu
Posts: 5514

Re: How do I check for StartTime (the first one in xml doc)

Tue Aug 12, 2014 8:28 am

Hi,

You can probably use an XPath like (//StartTime)[1] to select the first element in document order from the document.
XSLT specific questions can also be asked on the XSL-List:

http://www.mulberrytech.com/xsl/xsl-list/

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Return to “XSLT and FOP”

Who is online

Users browsing this forum: No registered users and 0 guests