10-11-2011, 06:37 PM | #1 | ||
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 >table border="1"< >tr bgcolor="#9acd32"< >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. |
||
10-11-2011, 06:40 PM | #2 |
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 |
10-12-2011, 03:38 PM | #3 |
High School JV
Join Date: Apr 2003
Location: Akron, OH
|
|
10-14-2011, 03:39 PM | #4 |
High School JV
Join Date: Apr 2003
Location: Akron, OH
|
anyone?
|
10-14-2011, 04:25 PM | #5 |
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. |
10-14-2011, 04:41 PM | #6 |
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 |
10-14-2011, 05:13 PM | #7 |
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.
|
10-15-2011, 08:02 AM | #8 |
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 |
10-15-2011, 11:18 AM | #9 |
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 |
10-15-2011, 02:34 PM | #10 | |
High School JV
Join Date: Apr 2003
Location: Akron, OH
|
Quote:
I will look into that. Thanks |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
|
|