Front Office Football Central  

Go Back   Front Office Football Central > Main Forums > Off Topic
Register FAQ Members List Calendar Mark Forums Read Statistics

Reply
 
Thread Tools
Old 10-11-2011, 06:37 PM   #1
Silver Owl
High School JV
 
Join Date: Apr 2003
Location: Akron, OH
XML help needed

I've been playing around with the yahoo fantasy sports API but can't get past this problem. I am just trying to pull data from an XML file but can't pull anything from this line

the XML code is :
>?xml version="1.0" encoding="UTF-8"?<
>query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng"
yahoo:count="1" yahoo:created="2011-10-11T22:16:44Z" yahoo:lang="en-US"<
>results<
>league xmlns="http://fantasysports.yahooapis.com/fantasy/v2/base.rng"<
>league_key<242.l.9137>/league_key<
>league_id<9137>/league_id<
>/league<
>/results<
>/query<


and the XSLT code is :

>?xml version="1.0" encoding="ISO-8859-1"?<
>!-- Edited by XMLSpy® --<
>xsl:stylesheet version="1.0
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"<
>xsl:template match="/"<
>html<
>body<
>h2/h2<
>table border="1"<
>tr bgcolor="#9acd32"<
>th/th<
>th/th<
>/tr<
>tr<
>td<>xsl:value-of select="query/results/league/league_key"/<>/td<
>td<>xsl:value-of select="query/results/league/league_id"/<>/td<
>/tr<
>/table<
>/body<
>/html<
>/xsl:template<
>/xsl:stylesheet<

I can't pull anything past the bolded line.
I am very inexperienced with this so any help would be greatly appreciated.

edit - I reversed all of the > < to get the code to show up.


Last edited by Silver Owl : 10-12-2011 at 03:37 PM.
Silver Owl is offline   Reply With Quote
Old 10-11-2011, 06:40 PM   #2
gstelmack
Pro Starter
 
Join Date: Oct 2000
Location: Cary, NC
You need to code-bracket that or something, the XML is not coming through.
__________________
-- Greg
-- Author of various FOF utilities
gstelmack is offline   Reply With Quote
Old 10-12-2011, 03:38 PM   #3
Silver Owl
High School JV
 
Join Date: Apr 2003
Location: Akron, OH
Quote:
Originally Posted by gstelmack View Post
You need to code-bracket that or something, the XML is not coming through.

Thanks, I think its showing up now.
Silver Owl is offline   Reply With Quote
Old 10-14-2011, 03:39 PM   #4
Silver Owl
High School JV
 
Join Date: Apr 2003
Location: Akron, OH
anyone?
Silver Owl is offline   Reply With Quote
Old 10-14-2011, 04:25 PM   #5
Matthean
Grizzled Veteran
 
Join Date: Aug 2008
I don't know enough to answer your question, but I was looking around on Yahoo's site and the "xmlns='http://fantasysports.yahooapis.com/fantasy/v2/base.rng'" part was in the same tag as xmlns:yahoo. If Yahoo's site has a forum for this kind of stuff, I would look there. webdeveloper and sitepoint fourms would be a couple web dev. forums worth looking at for places to get feedback as well.
__________________
Board games: Bringing people back to the original social network, the table.
Matthean is offline   Reply With Quote
Old 10-14-2011, 04:41 PM   #6
Ronnie Dobbs2
Pro Rookie
 
Join Date: Jun 2012
Location: Bahston Mass
Not experienced with XSLT.

Is it a permissions thing? Opening http://fantasysports.yahooapis.com/fantasy/v2/base.rng yields an OAuth credentialing problem.
__________________
There's no I in Teamocil, at least not where you'd think
Ronnie Dobbs2 is offline   Reply With Quote
Old 10-14-2011, 05:13 PM   #7
Radii
Head Coach
 
Join Date: Jul 2001
yeah i've never done enough with xslt to get any sort of nuances with it, but I know the namespace elements (xmlns) add a level of complication to it and that is likely what's screwing you up, I just don't know how to deal with it.
Radii is offline   Reply With Quote
Old 10-15-2011, 08:02 AM   #8
Silver Owl
High School JV
 
Join Date: Apr 2003
Location: Akron, OH
Thanks guys, Radii is correct that the namespace element is the problem. I just can't figure out how to get around it. It doesn't help that I also don't know what I am doing.

Ronnie Dobbs2
You are right about the permissions. Yahoo has a console where you can get XML data without the permissions. In order to use the data on a website you have to go through the OAuth process.

Matthean
I will search some webdeveloper and sitepoint fourms.

thanks guys
Silver Owl is offline   Reply With Quote
Old 10-15-2011, 11:18 AM   #9
Ronnie Dobbs2
Pro Rookie
 
Join Date: Jun 2012
Location: Bahston Mass
One thing you might want to try is avoiding the XML altogether and using the Yahoo! Query Language. Works seemlessly with AJAX calls and can return JSON which is a breeze to work with. I believe support for Yahoo! Fantasy is provided.

http://developer.yahoo.com/yql/
__________________
There's no I in Teamocil, at least not where you'd think
Ronnie Dobbs2 is offline   Reply With Quote
Old 10-15-2011, 02:34 PM   #10
Silver Owl
High School JV
 
Join Date: Apr 2003
Location: Akron, OH
Quote:
Originally Posted by Ronnie Dobbs2 View Post
One thing you might want to try is avoiding the XML altogether and using the Yahoo! Query Language. Works seemlessly with AJAX calls and can return JSON which is a breeze to work with. I believe support for Yahoo! Fantasy is provided.

http://developer.yahoo.com/yql/

I will look into that. Thanks
Silver Owl is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is On
Forum Jump


All times are GMT -5. The time now is 11:30 PM.



Powered by vBulletin Version 3.6.0
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.