XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old August 20th, 2003, 09:14 AM
RavaGe RavaGe is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2001
Posts: 10 RavaGe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Schedule Listing with XSL (For Pros Only)

I have an XML document with a bunch of dates that I want to output chronologically. I need the days in the month that DON'T have an equivalent XML node (i.e. Empty) to still output something the likes of "FREE DAY".

In any normal programming language I'd begin with a loop for ($x = 1; $x < 31; $x++) and go through the xml doc day by day and either output the xml data if there is some for that day or output "FREE DAY" if not.

...But XSLT likes to do these kind of things completely different... How?

Any push in the right direction is appreciated!

Reply With Quote
  #2  
Old August 20th, 2003, 01:38 PM
mulligh mulligh is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 19 mulligh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
XSLT doesn't have any built-in functions for handling dates. You may be able to extract the day from an element. If the days are in a separate element, it wouldn't be a problem.

If you give us some of your code, we could help you further.

Reply With Quote
  #3  
Old August 20th, 2003, 01:58 PM
RavaGe RavaGe is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2001
Posts: 10 RavaGe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
My problem isn't date-specific in that it requires date functions. I realize that XSLT without any extensions is quite limited.

I'm trying to make a list of elements by not only iterating over the nodes in the xml document, but also nodes that *might not* be there. In my specific case it means "days in a calendar"

Say I've got XML code like this:

Code:
<calendar>
	<day dayofmonth="1">work</day>
	<day dayofmonth="2">gym</day>
	<day dayofmonth="4">more work</day>
</calendar>


I want to spit out a list with the whole week like this:

1. work
2. gym
3. FREE TIME
4. more work

There is no node with dayofmonth="3", yet, I want it to output FREE TIME if that is the case.

XSLT, by its very nature doesn't seem to be able to do that. I hope I'm wrong.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Schedule Listing with XSL (For Pros Only)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway