Go to Post It's what this is all about. Making dreams happen. - Astronouth7303 [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #14   Spotlight this post!  
Unread 31-10-2009, 11:25
Andrew Schreiber Andrew Schreiber is offline
Joining the 900 Meme Team
FRC #0079
 
Join Date: Jan 2005
Rookie Year: 2000
Location: Misplaced Michigander
Posts: 4,077
Andrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond repute
Re: FRC Event Data in XML Format

Quote:
Originally Posted by Nibbles View Post
If their server supports it, you could turn the cache down to one or two minutes and send an If-Modified-Since header, in which case the server will tell you if nothing has changed and not send a response. In addition, for games in years past, why not increase the cache to an hour or even a day? The score probably won't change.

A few notes on syntax, looking at /2009/Greater Toronto/awards:
Spaces are not allowed in tag names - it is parsed as an attribute without a value. There is a leading nonbreaking space (&nbsp in many of the tag values (Home town, name, team).   is not a predefined entity, you will need a DTD declaration if you want to define it. Or just replace them with a standard space. It looks like FIRST doesn't use any entity other than  , but you will need to be careful if in the future they do, that has to get parsed correctly. The ampersands need to be escaped, too, into "&" .

As for URL parsing, are you using a regular expression?
Code:
(/(\d{4}))?(/(.+))(/(qualification|elimination))?(/(awards|schedule|rankings|results))(/(json|xml|human))?
After matching, you would have $2 as year, $4 as event, $6 as qualification/elimination, $8 as awards/etc, $10 as json/etc (if that makes any sense).
URL Parsing has been fixed, I ended up basically splitting the string apart at the "/" character and then looping through them. For everything except Event I have a lookup table and if it is in there it marks it as such and then moves to the next one. This allows it to work like /2009/Greater Toronto/XML/Schedule/Qualification or /2009/Greater Toronto/Qualification/Schedule/XML

I will get to doing the escaping stuff today, I'll replace the spaces in the tag name with a _ and pull out the   characters. I will also take care of ampersand and quotes while I am at it.

Thanks for your comments.
__________________




.
Reply With Quote
 


Thread Tools
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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
2009 FRC Kit of Parts (Pro/ENGINEER format) - Supported by PTC PTC_FRC CAD 18 18-11-2009 01:02
FIRST Event Data in XML format Andrew Schreiber Technical Discussion 11 03-05-2009 04:18
XML Interchange format Nibbles Scouting 25 03-10-2008 02:09
How to write image data to binary PGM file format(P5)? tommy_chai Programming 0 08-10-2007 08:22
Scouting Data Interchange Format proegssilb Scouting 7 06-06-2007 19:29


All times are GMT -5. The time now is 22:29.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi