Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old September 11th, 2008, 08:43 PM
Newbie
 
Join Date: Feb 2008
Posts: 4
Default Select XML Element by testing date data

I need to select out elements in an XML file based on whether date infomation is greater than a constant.

I need something like: test="ENTERED_AT > 07:40AM", but that doesn't work with the XML data I have. Does anyone have an idea how I can do this.

We are a radio station that publishes school closing information on our web site. I installed this school closing system we bought from a vendor that doesn't output the data like I need it to be included in our web page. I got the vendor to output XML and now I'm using Dreamweaver CS3 to manipulate the XML and build my pages with XSLT. Have it working for most things, except this report where I want to see only closings that have been entered after 7:40AM.

I'm inexperienced with XML & XSLT. Would this be something to do with the substring function or date/time formatting?

Here is small example of the XML file data:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE ORGANIZATION (View Source for full doctype...)>
- <WEBCLOSE_XML>
- <ORGANIZATION>
<CATEGORY>SCHOOLS</CATEGORY>
<ORG_ID>2000</ORG_ID>
<ORG>WBCL Test School</ORG>
<STATUS>Three Hour Delay, Kindergarten Alternate Schedule</STATUS>
<STATUS2 />
<ENTERED_ON>09/11/2008</ENTERED_ON>
<ENTERED_AT>03:16:41 PM</ENTERED_AT>
<STATUS1LONG />
<STATUS2LONG />
<ZIPCODE>46807</ZIPCODE>
<CITY>Fort Wayne</CITY>
<STATE>IN</STATE>
<COUNTY>Allen</COUNTY>
</ORGANIZATION>
</WEBCLOSE_XML>

Its that ENTERED_AT element I need to be able to test against. Your help is greatly appreciated.
Reply
  #2  
Old September 12th, 2008, 05:18 AM
Dormilich's Avatar
Expert
 
Join Date: Aug 2008
Location: Leipzig, Germany
Age: 31
Posts: 668
Default

for a quick start I would say, that you try to compare two strings with a > operator. You have to somehow convert it to numbers. I will take a look at it.

regards
Reply
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles