Silver Owl
10-11-2011, 05:37 PM
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<League Info>/h2<
>table border="1"<
>tr bgcolor="#9acd32"<
>th<Key>/th<
>th<ID>/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.
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<League Info>/h2<
>table border="1"<
>tr bgcolor="#9acd32"<
>th<Key>/th<
>th<ID>/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.