I am updating the asp.net v3.5 web application. to v4, and I ran into some problems with XSLT transformations that I use for XmlDataSource objects.
Part of the XSLT file:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:HttpUtility="ds:HttpUtility">
<xsl:output method="xml" indent="yes" encoding="utf-8"/>
<xsl:template match="/Menus">
<MenuItems>
<xsl:call-template name="MenuListing" />
</MenuItems>
</xsl:template>
<xsl:template name="MenuListing">
<xsl:apply-templates select="Menu" />
</xsl:template>
<xsl:template match="Menu">
<MenuItem>
<xsl:attribute name="Text">
<xsl:value-of select="HttpUtility:HtmlEncode(MenuTitle)"/>
</xsl:attribute>
<xsl:attribute name="ToolTip">
<xsl:value-of select="MenuTitle"/>
</xsl:attribute>
</MenuItem>
</xsl:template>
</xsl:stylesheet>
The problem seems to be in line
<xsl:value-of select="HttpUtility:HtmlEncode(MenuTitle)"/>
Removing this and replacing it with plain text will work. How to set up an XML data source:
xmlDataSource.TransformArgumentList.AddExtensionObject("ds:HttpUtility", new System.Web.HttpUtility());
xmlDataSource.Data = Cache.FetchPageMenu();
I searched Microsoft pages for any changes in v4 but cannot find them. All this worked fine in version 3.5 (and before version 2). Without receiving any errors, the data simply is not displayed.
source
share