3 Replies Latest reply on Sep 6, 2007 6:22 AM by Newsgroup_User

    xml not displaying because of & symbol

    satjack1 Level 1
      Hi there

      I have an issue with an xml file not displaying ..the reason is the & symbol in the xml file. I created a scoreboard xml file ..however when Texas A&M was inputted ..it does not display any information in the xml file ..when removed ..it displays fine.

      Is there a code I can incorporate info the xsl file to over right the & symbol so it still displays? Any help would be greatly appreciated. Below is the working xml file ..and the xsl file ..thanks Rob

      <xsl:stylesheet version="1.0" exclude-result-prefixes="xsl ddwrt msxsl" xmlns:ddwrt=" http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:xsl=" http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:ddwrt2="urn:frontpage:internal">
      <xsl:param name="dvt_adhocmode"></xsl:param>
      <xsl:param name="dvt_adhocfiltermode">xsl</xsl:param>
      <xsl:param name="dvt_fieldsort"></xsl:param>
      <xsl:param name="dvt_sortfield"></xsl:param>
      <xsl:param name="dvt_groupfield"></xsl:param>
      <xsl:param name="dvt_groupdisplay"></xsl:param>
      <xsl:param name="dvt_sortdir">ascending</xsl:param>
      <xsl:param name="dvt_groupdir">ascending</xsl:param>
      <xsl:param name="dvt_grouptype"></xsl:param>
      <xsl:param name="dvt_sorttype">text</xsl:param>
      <xsl:param name="dvt_groupsorttype">text</xsl:param>
      <xsl:param name="dvt_filterfield"></xsl:param>
      <xsl:param name="dvt_filterval"></xsl:param>
      <xsl:param name="dvt_filtertype"></xsl:param>
      <xsl:param name="dvt_firstrow">1</xsl:param>
      <xsl:param name="dvt_nextpagedata"></xsl:param>
      <xsl:param name="dvt_apos">'</xsl:param>
      <xsl:param name="filterParam"></xsl:param>
      <xsl:template match="/">
      <xsl:call-template name="dvt_1"/>
      </xsl:template>
      <xsl:template name="dvt_1">
      <xsl:variable name="StyleName">Table</xsl:variable>
      <xsl:variable name="Rows" select="/channel/item"/>
      <xsl:variable name="RowCount" select="count($Rows)"/>
      <xsl:variable name="IsEmpty" select="$RowCount = 0"/>
      <xsl:choose>
      <xsl:when test="$IsEmpty">
      <xsl:call-template name="dvt_1.empty"/>
      </xsl:when>
      <xsl:otherwise>
      <table border="0" width="100%" cellpadding="2" cellspacing="0">
      <tr valign="top">
      <th class="ms-vh" nowrap="nowrap" style="text-align: left; font-family: Verdana; font-size: small; color: #FFFFFF; width: 56px; background-color: #800000">Date</th>
      <th class="ms-vh" nowrap="nowrap" style="text-align: left; font-family: Verdana; font-size: small; color: #FFFFFF; width: 122px; background-color: #800000">Sport</th>
      <th class="ms-vh" nowrap="nowrap" style="text-align: left; font-family: Verdana; font-size: small; color: #FFFFFF; background-color: #800000">Final Score</th></tr>
      <xsl:call-template name="dvt_1.body">
      <xsl:with-param name="Rows" select="$Rows"/>
      <xsl:with-param name="FirstRow" select="1"/>
      <xsl:with-param name="LastRow" select="$RowCount"/>
      </xsl:call-template>
      </table>
      </xsl:otherwise>
      </xsl:choose>
      </xsl:template>
      <xsl:template name="dvt_1.body">
      <xsl:param name="Rows"/>
      <xsl:param name="FirstRow"/>
      <xsl:param name="LastRow"/>
      <xsl:for-each select="$Rows">
      <xsl:sort select="date" order="ascending" />
      <xsl:sort select="title" order="descending" />
      <xsl:variable name="KeepItemsTogether" select="false()"/>
      <xsl:variable name="HideGroupDetail" select="false()"/>
      <xsl:variable name="GroupStyle" select="'auto'"/>
      <xsl:if test="true()">
      <xsl:if test="not($HideGroupDetail)" ddwrt:cf_ignore="1">
      <tr style="display:{$GroupStyle}">
      <td class="ms-vb" style="text-align: left; font-family: Verdana; font-size: xx-small; width: 56px; border: 1px solid #000000">
      <xsl:value-of select="date"/>
      </td>
      <td class="ms-vb" style="text-align: left; font-family: Verdana; font-size: xx-small; width: 122px; border: 1px solid #000000">
      <strong><xsl:value-of select="title" /></strong></td>
      <td class="ms-vb" style="text-align: left; font-family: Verdana; font-size: xx-small; border: 1px solid #000000">
      <strong><xsl:value-of select="description" /></strong></td></tr>
      </xsl:if>
      </xsl:if>
      </xsl:for-each>
      </xsl:template>
      <xsl:template name="dvt_1.empty">
      <xsl:variable name="ViewEmptyText">There are no items to show in this view.</xsl:variable>
      <table border="0" width="100%">
      <tr>
      <td class="ms-vb">
      <xsl:value-of select="$ViewEmptyText"/>
      </td>
      </tr>
      </table>
      </xsl:template>
      </xsl:stylesheet>



      <?xml version="1.0" encoding="iso-8859-1"?>
      <channel>
      <title>Sports Scores</title>
      <ttl></ttl>
      <link></link>
      <description>Latest Scores</description>
      <language></language>
      <pubDate></pubDate>
      <item>
      <title>College Football</title>
      <date>31AUG07</date>
      <description>Eastern Washington 52 - Montana-Western 13</description>
      </item>
      <item>
      <title>College Football</title>
      <date>01SEP07</date>
      <description>Carroll 17 - Black Hills State 0</description>
      </item>
      <item>
      <title>College Football</title>
      <date>01SEP07</date>
      <description>Carroll College 17 - Black Hills St. 0</description>
      </item>
      <item>
      <title>College Football</title>
      <date>01SEP07</date>
      <description>Eastern Washington 52 - Western 13</description>
      </item>
      <item>
      <title>College Football</title>
      <date>01SEP07</date>
      <description>Montana 37 - S. Utah 17</description>
      </item>
      <item>
      <title>College Football</title>
      <date>01SEP07</date>
      <description>Montana 37 - Southern Utah 17</description>
      </item>
      <item>
      <title>College Football</title>
      <date>01SEP07</date>
      <description>MSU Northern 18 - Dickenson St. 10</description>
      </item>
      <item>
      <title>College Football</title>
      <date>01SEP07</date>
      <description>Northern 18 - Dickinson State 10</description>
      </item>
      <item>
      <title>College Football</title>
      <date>01SEP07</date>
      <description>Rocky 21 - Minot State 9</description>
      </item>
      <item>
      <title>College Football</title>
      <date>01SEP07</date>
      <description>Southern Oregon 45 - Eastern Oregon 42 (OT)</description>
      </item>
      <item>
      <title>College Football</title>
      <date>01SEP07</date>
      <description>Texas AM 38 - Montana St. 7</description>
      </item>
      </channel>


        • 1. Re: xml not displaying because of &amp; symbol
          Level 7
          A&amp;M

          --
          Murray --- ICQ 71997575
          Adobe Community Expert
          (If you *MUST* email me, don't LAUGH when you do so!)
          ==================
          http://www.dreamweavermx-templates.com - Template Triage!
          http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
          http://www.dwfaq.com - DW FAQs, Tutorials & Resources
          http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
          ==================


          "satjack1" <webforumsuser@macromedia.com> wrote in message
          news:fbn4rq$dao$1@forums.macromedia.com...
          > Hi there
          >
          > I have an issue with an xml file not displaying ..the reason is the &
          > symbol
          > in the xml file. I created a scoreboard xml file ..however when Texas A&M
          > was
          > inputted ..it does not display any information in the xml file ..when
          > removed
          > ..it displays fine.
          >
          > Is there a code I can incorporate info the xsl file to over right the &
          > symbol
          > so it still displays? Any help would be greatly appreciated. Below is
          > the
          > working xml file ..and the xsl file ..thanks Rob
          >
          > <xsl:stylesheet version="1.0" exclude-result-prefixes="xsl ddwrt msxsl"
          > xmlns:ddwrt=" http://schemas.microsoft.com/WebParts/v2/DataView/runtime"
          > xmlns:xsl=" http://www.w3.org/1999/XSL/Transform"
          > xmlns:msxsl="urn:schemas-microsoft-com:xslt"
          > xmlns:ddwrt2="urn:frontpage:internal">
          > <xsl:param name="dvt_adhocmode"></xsl:param>
          > <xsl:param name="dvt_adhocfiltermode">xsl</xsl:param>
          > <xsl:param name="dvt_fieldsort"></xsl:param>
          > <xsl:param name="dvt_sortfield"></xsl:param>
          > <xsl:param name="dvt_groupfield"></xsl:param>
          > <xsl:param name="dvt_groupdisplay"></xsl:param>
          > <xsl:param name="dvt_sortdir">ascending</xsl:param>
          > <xsl:param name="dvt_groupdir">ascending</xsl:param>
          > <xsl:param name="dvt_grouptype"></xsl:param>
          > <xsl:param name="dvt_sorttype">text</xsl:param>
          > <xsl:param name="dvt_groupsorttype">text</xsl:param>
          > <xsl:param name="dvt_filterfield"></xsl:param>
          > <xsl:param name="dvt_filterval"></xsl:param>
          > <xsl:param name="dvt_filtertype"></xsl:param>
          > <xsl:param name="dvt_firstrow">1</xsl:param>
          > <xsl:param name="dvt_nextpagedata"></xsl:param>
          > <xsl:param name="dvt_apos">'</xsl:param>
          > <xsl:param name="filterParam"></xsl:param>
          > <xsl:template match="/">
          > <xsl:call-template name="dvt_1"/>
          > </xsl:template>
          > <xsl:template name="dvt_1">
          > <xsl:variable name="StyleName">Table</xsl:variable>
          > <xsl:variable name="Rows" select="/channel/item"/>
          > <xsl:variable name="RowCount" select="count($Rows)"/>
          > <xsl:variable name="IsEmpty" select="$RowCount = 0"/>
          > <xsl:choose>
          > <xsl:when test="$IsEmpty">
          > <xsl:call-template name="dvt_1.empty"/>
          > </xsl:when>
          > <xsl:otherwise>
          > <table border="0" width="100%" cellpadding="2" cellspacing="0">
          > <tr valign="top">
          > <th class="ms-vh" nowrap="nowrap" style="text-align: left; font-family:
          > Verdana; font-size: small; color: #FFFFFF; width: 56px; background-color:
          > #800000">Date</th>
          > <th class="ms-vh" nowrap="nowrap" style="text-align: left; font-family:
          > Verdana; font-size: small; color: #FFFFFF; width: 122px; background-color:
          > #800000">Sport</th>
          > <th class="ms-vh" nowrap="nowrap" style="text-align: left; font-family:
          > Verdana; font-size: small; color: #FFFFFF; background-color:
          > #800000">Final
          > Score</th></tr>
          > <xsl:call-template name="dvt_1.body">
          > <xsl:with-param name="Rows" select="$Rows"/>
          > <xsl:with-param name="FirstRow" select="1"/>
          > <xsl:with-param name="LastRow" select="$RowCount"/>
          > </xsl:call-template>
          > </table>
          > </xsl:otherwise>
          > </xsl:choose>
          > </xsl:template>
          > <xsl:template name="dvt_1.body">
          > <xsl:param name="Rows"/>
          > <xsl:param name="FirstRow"/>
          > <xsl:param name="LastRow"/>
          > <xsl:for-each select="$Rows">
          > <xsl:sort select="date" order="ascending" />
          > <xsl:sort select="title" order="descending" />
          > <xsl:variable name="KeepItemsTogether" select="false()"/>
          > <xsl:variable name="HideGroupDetail" select="false()"/>
          > <xsl:variable name="GroupStyle" select="'auto'"/>
          > <xsl:if test="true()">
          > <xsl:if test="not($HideGroupDetail)" ddwrt:cf_ignore="1">
          > <tr style="display:{$GroupStyle}">
          > <td class="ms-vb" style="text-align: left; font-family: Verdana;
          > font-size: xx-small; width: 56px; border: 1px solid #000000">
          > <xsl:value-of select="date"/>
          > </td>
          > <td class="ms-vb" style="text-align: left; font-family: Verdana;
          > font-size: xx-small; width: 122px; border: 1px solid #000000">
          > <xsl:value-of select="title" /></td>
          > <td class="ms-vb" style="text-align: left; font-family: Verdana;
          > font-size: xx-small; border: 1px solid #000000">
          > <xsl:value-of select="description" /></td></tr>
          > </xsl:if>
          > </xsl:if>
          > </xsl:for-each>
          > </xsl:template>
          > <xsl:template name="dvt_1.empty">
          > <xsl:variable name="ViewEmptyText">There are no items to show in this
          > view.</xsl:variable>
          > <table border="0" width="100%">
          > <tr>
          > <td class="ms-vb">
          > <xsl:value-of select="$ViewEmptyText"/>
          > </td>
          > </tr>
          > </table>
          > </xsl:template>
          > </xsl:stylesheet>
          >
          >
          >
          > <?xml version="1.0" encoding="iso-8859-1"?>
          > <channel>
          > <title>Sports Scores</title>
          > <ttl></ttl>
          > <link></link>
          > <description>Latest Scores</description>
          > <language></language>
          > <pubDate></pubDate>
          > <item>
          > <title>College Football</title>
          > <date>31AUG07</date>
          > <description>Eastern Washington 52 - Montana-Western
          > 13</description>
          > </item>
          > <item>
          > <title>College Football</title>
          > <date>01SEP07</date>
          > <description>Carroll 17 - Black Hills State 0</description>
          > </item>
          > <item>
          > <title>College Football</title>
          > <date>01SEP07</date>
          > <description>Carroll College 17 - Black Hills St. 0</description>
          > </item>
          > <item>
          > <title>College Football</title>
          > <date>01SEP07</date>
          > <description>Eastern Washington 52 - Western 13</description>
          > </item>
          > <item>
          > <title>College Football</title>
          > <date>01SEP07</date>
          > <description>Montana 37 - S. Utah 17</description>
          > </item>
          > <item>
          > <title>College Football</title>
          > <date>01SEP07</date>
          > <description>Montana 37 - Southern Utah 17</description>
          > </item>
          > <item>
          > <title>College Football</title>
          > <date>01SEP07</date>
          > <description>MSU Northern 18 - Dickenson St. 10</description>
          > </item>
          > <item>
          > <title>College Football</title>
          > <date>01SEP07</date>
          > <description>Northern 18 - Dickinson State 10</description>
          > </item>
          > <item>
          > <title>College Football</title>
          > <date>01SEP07</date>
          > <description>Rocky 21 - Minot State 9</description>
          > </item>
          > <item>
          > <title>College Football</title>
          > <date>01SEP07</date>
          > <description>Southern Oregon 45 - Eastern Oregon 42
          > (OT)</description>
          > </item>
          > <item>
          > <title>College Football</title>
          > <date>01SEP07</date>
          > <description>Texas AM 38 - Montana St. 7</description>
          > </item>
          > </channel>
          >
          >
          >
          >


          • 2. Re: xml not displaying because of &amp; symbol
            satjack1 Level 1
            Hi Murray

            thanks for your response.

            Is there something I can put into the .xsl file that will over right or strip the & symbol. There are many people who input the .xml data and if an & is typed in ..the xml will not display ..thanks Rob
            • 3. Re: xml not displaying because of &amp; symbol
              Level 7
              Beats me. But I don't think so.

              --
              Murray --- ICQ 71997575
              Adobe Community Expert
              (If you *MUST* email me, don't LAUGH when you do so!)
              ==================
              http://www.dreamweavermx-templates.com - Template Triage!
              http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
              http://www.dwfaq.com - DW FAQs, Tutorials & Resources
              http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
              ==================


              "satjack1" <webforumsuser@macromedia.com> wrote in message
              news:fbounl$ef1$1@forums.macromedia.com...
              > Hi Murray
              >
              > thanks for your response.
              >
              > Is there something I can put into the .xsl file that will over right or
              > strip
              > the & symbol. There are many people who input the .xml data and if an &
              > is
              > typed in ..the xml will not display ..thanks Rob
              >