Copied to clipboard

Flag this post as spam?

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


  • Malte Baden Hansen 61 posts 158 karma points
    Aug 19, 2010 @ 01:12
    Malte Baden Hansen
    0

    Error parsing EntityName. when writing no or da

    Hi

    When trying to save this line i get an error saying

    <xsl:variable name="weatherUrl" select="'http://www.google.com/ig/api?weather=aalborg&amp;hl=da'" />
    "System.Xml.XmlException: An error occurred while parsing EntityName. Line 3, position 62. "

    But when i instead of "da" writes "en". It works and i am allowed to save it.

    I simply do not understand, because it seems like some xslt reserved stuff is interfering.
    Thanks in advance =)

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Aug 19, 2010 @ 09:26
    Chriztian Steinmeier
    0

    Hi Malte - could you please post the XSLT formatted with the "Code" option, so we can see exactly what's going on.

    (There's obviously a problem with the ampersand character in the URL - but the way the URL gets formatted with the "Paragraph" option makes it a bit ambiguous for us to decipher...

    /Chriztian

  • Malte Baden Hansen 61 posts 158 karma points
    Aug 19, 2010 @ 09:32
    Malte Baden Hansen
    0

    Yes of course :)

    <xsl:template match="/">
      <xsl:variable name="language" select="'da'" />
        <xsl:variable name="weatherUrl" select="'http://www.google.com/ig/api?weather=aalborg&hl=en'" />
        <xsl:variable name="xmlnodes" select="umbraco.library:GetXmlDocumentByUrl($weatherUrl)"/>

      <xsl:value-of select="$weatherUrl"/>
      <div style="background-color: red; padding: 5px;">
        <xsl:for-each select="$xmlnodes/xml_api_reply/weather/current_conditions">
          <xsl:value-of select="condition/@data" /> <br />
      xsl:for-each>
      div>
      
    xsl:template>
Please Sign in or register to post replies

Write your reply to:

Draft