Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Scott Campbell 4 posts 24 karma points
    Jun 25, 2010 @ 16:37
    Scott Campbell
    0

    GetXmlDocumentByUrl help

    Over the last few days I have been trying to work out how to bring a World of Warcraft armory feed into my site but without success. I'm not sure if it is because the format is wrong or I am doing it wrong, but I am unable to pull any information from the nodes. Running the same code (with changed node names) on other RSS feeds seems to work, can anyone tell me why I can't pull information from nodes from this feed.

    An example feed can be viewed here:
    http://www.wowarmory.com/character-feed.atom?r=Dreadmaul&cn=Crunchballs&locale=en_US

    My XSLT is here:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet
     version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:msxml="urn:schemas-microsoft-com:xslt"
     xmlns:umbraco.library="urn:umbraco.library"
     exclude-result-prefixes="msxml umbraco.library">
    <xsl:output method="xml" omit-xml-declaration="yes"/>

    <xsl:param name="currentPage"/>

    <xsl:template match="/">
    <!-- start writing XSLT -->
    <xsl:for-each select="$currentPage/ancestor-or-self::root//node [@nodeTypeAlias='Feed Item']">
      <xsl:variable name="url" select="string(data[@alias='url'])" />
      <!-- Is the url populated? -->
      <xsl:if test="string-length($url) &gt; 0">
        <xsl:variable name="feedContent" select="umbraco.library:GetXmlDocumentByUrl( $url )"/>
        <xsl:value-of select="$feedContent/feed/author/name"/>
    <xsl:for-each select="exsl:node-set($feedContent)//entry">
        <xsl:value-of select="title"/>
    </xsl:for-each>
      </xsl:if>
    </xsl:for-each>

    </xsl:template>

    </xsl:stylesheet>

  • Scott Campbell 4 posts 24 karma points
    Jun 25, 2010 @ 17:21
    Scott Campbell
    0

    As soon as I post up an this request I manage to find the reason and a solution. Why couldn't I have found this with all the searching I had done earlier.

    http://our.umbraco.org/forum/developers/xslt/8016-getXMLDocument-won't-display-any-content

Please Sign in or register to post replies

Write your reply to:

Draft