William Duffy

Glasgow Based C# ASP.NET Web Developer

Tag archive for ‘XML’

Modifing XML values in XSLT documents

Ever wondered how to perform manipulations of XML values in an XSLT document? For example, if you were consuming an RSS feed which had description values greater than 500 characters in length, but you only wanted to display the first 50 characters before leading the user through to the full post. The solution is XPath [...]

RssResult – An ASP.NET MVC RSS ActionResult

One of the most common tasks for data serving websites is offering an RSS feed that users can subscribe to in order to keep up with the latest updates to that data. Previously I posted the article Creating a simple RSS feed using ASP.NET MVC which demonstrated how to create an RSS feed in a [...]

Creating a simple RSS feed using ASP.NET MVC

Looking to serve an rss document via your ASP.NET MVC controller? Here is a simple, quick means to do so. If you are looking for a much neater, smarter, reusable method of serving rss from your controllers check out my ASP.NET MVC RssResult post (coming soon). For the demonstrations below I will be using a [...]

Stop XSL from escaping ampersands in html entities

I had a real hard time today trying to work out why my encoded XML document was being re-encoded when rendered using XSLT. My problem was that an apostrophy ( ‘ ) in my XML was properly encoded to ’ If this is presented to the browser “as-is” then the html entity is correctly rendered [...]

How to consume an XML feed in ASP.NET – RSS

XML is the standard for distributing content on the internet, however it can prove a challenge when trying to consume and handle the data retrieved from an XML document. This is the first in a two part series on consuming and displaying XML content on your own website. We will be using XPathDocument and XPathNavigator [...]

Parsing dates when ASP.NET’s DateTime.Parse doesn’t work

Has DateTime.Parse ever thrown the following exception when you passed it a legally formatted value, leaving you bemused as to why it can’t parse it? String was not recognized as a valid DateTime As powerful as DateTime.Parse is, it cannot handle every representation of a date/time value without a little help from you, the developer. [...]