Front Office Football Central

Front Office Football Central (https://forums.operationsports.com/fofc//index.php)
-   Off Topic (https://forums.operationsports.com/fofc//forumdisplay.php?f=6)
-   -   XML help needed (https://forums.operationsports.com/fofc//showthread.php?t=82519)

Silver Owl 10-11-2011 05:37 PM

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.

gstelmack 10-11-2011 05:40 PM

You need to code-bracket that or something, the XML is not coming through.

Silver Owl 10-12-2011 02:38 PM

Quote:

Originally Posted by gstelmack (Post 2547072)
You need to code-bracket that or something, the XML is not coming through.


Thanks, I think its showing up now.

Silver Owl 10-14-2011 02:39 PM

anyone?

Matthean 10-14-2011 03:25 PM

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.

Ronnie Dobbs2 10-14-2011 03:41 PM

Not experienced with XSLT.

Is it a permissions thing? Opening http://fantasysports.yahooapis.com/fantasy/v2/base.rng yields an OAuth credentialing problem.

Radii 10-14-2011 04:13 PM

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.

Silver Owl 10-15-2011 07:02 AM

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

Ronnie Dobbs2 10-15-2011 10:18 AM

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/

Silver Owl 10-15-2011 01:34 PM

Quote:

Originally Posted by Ronnie Dobbs2 (Post 2549796)
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


All times are GMT -5. The time now is 08:49 PM.

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