Contents tagged with xml
Sending XML to an ASP.NET MVC Action Method Argument
I read a great article recently by Phil Haack on sending JSON to an action method. This was very timely as I wanted to do exactly that in the REST API I've been created for a video hosting website. However, I wanted to make it work with XML as well as JSON. Phil Haack creates something called a JSON value provider, so I followed his example and created an XML value provider. I've used it on two projects now and it's worked a treat. I thought I'd share it with the world in the hope that it will be useful to others. Source code XML Value Provider (C# source) To get this working in your project … more
ActionScript 3 timeout problems when working with XML
I was getting the following error while developing my doodle flash application using ActionScript 3.0: 1502 A script has executed for longer than the default timeout period of 15 seconds. I tracked the problem down to a piece of code that looped through a large XML document. At first I thought there was nothing I could do, but after playing about with it and pulling my hair out for a while I found out several things that helped me reduce the runtime by an impressive amount. I wanted to share my findings in case anyone else was having similar problems. Finding 1: XML .. operator is very slow … more
Sending a list into an SQL stored procedure using XML
I wanted to pass a list of user IDs into a stored procedure. What I really wanted was to be able to pass an array, but you're not able to do that because it would be too easy. It took me quite a while to figure this out, but now I know how, it'll be easy next time. There's a nice set of functions that allow you to get values from an XML string and treat the set of values like a table. Just what I wanted from arrays really. Here is the XML string that I used: <users><user id="24" /><user id="27" /></users> And here is the relevant part of the stored procedure I made: … more
