XML is a universal format for data exchange, most of the data repository owners store their data in xml format, and apply XSLT to transform the XML from one format to another when required, I came across to a similar project, where we were storing everything in XML and then while processing the data we needed to display in other format.

Have written my own small transformation utility with extension object support.

Transform method:

/// <summary>
/// perform the XSLT transformation on the input xml and provides the transformed xml
/// </summary>
/// <param name=”transformation”>contains input xml, xslt path, and output xml</param>
public static void Transform(ITransformation transformation)
{
string sourceXML = transformation.SourceXML;
using (XmlReader reader = XmlReader.Create(new StringReader(sourceXML)))
{
//instead of initializing it with a new instance every time, get the transformation from the static cache.
//it will improve the load time of transformation object
XslCompiledTransform xslt = PrepareTransformationObject(transformation.XSLTName);

XsltArgumentList args = new XsltArgumentList();
//adding extension object, it will work as a helper method from XSLT
args.AddExtensionObject(“urn:Util”, new Util(transformation.XsltParameters));

//passing the current date as transformation date, you can pass any object and then access it in util class.
XsltParam xsltParam = new XsltParam();
xsltParam.Params.Add(“TransactionDate”, DateTime.Now.ToShortDateString());

There are lots of error logging providers available such as Log4Net, AnLogger, etc. they are easy to use as well, but just to keep it simple, I have written my own. I call it “Activity and Error Logger”, it stores the data in xml format, request by request and session by session, you can actually create the user behaviour maps if you properly call the activity log at while performing any major operations. It also takes care of the concurrency, two threads will not overwrite each other. It logs the errors on page in try catch block and also at global level, in Application_Error event in global.asax

1) Include the Logging.cs class in App_Code folder of your project

2) Configure the web.config

3) Set the Application_Error in global.asax

4) Create the Logs_App and logs_Error folders in your project and you are done

5) It creates one log file on hourly basis, one for Activities and one for Errors

6) Now to log the activity or error, you just have to call the Logging.LogInfo or Logging. LogException functions in your code wherever required.

Logging.cs:

Include the Logging.cs class from the source code attached in this article

Web.config:

Add the below line in <configSections> if there is no configsections tag in your config, then create one right inside the <configuration> tag:

I have also made the admin part of the application, to create a report of activity logs, it applies the xslt on the activity log files and display them in a grid, you can extend it to create one for error log files too :

So far I have been in very dilemmatic situation whether to develop a native mobile application, having a buzz in the market to have mobile app for almost every application. I always wanted to try my hands on it, but somehow I never ever could start on it. Quite a few times I did setup IDE and SDKs to develop android application, but every time I started I could not carry on.

Being a web developer, always wanted to build the mobile application which will work on all platforms, but again a mini war between these mobile giants never encouraged a common SDK on IDE to develop the same.

To start my day, I always scan through all tech newsletters, 1 week back I found one article, Cross-Platform mobile applications using PhoneGap and JQuery (HTML5 and CSS3), as always curious to know about it, clicked through the link and read the article, understood the concept and somehow liked it so much, they kept it simple but effective. I was happy, finally I could start my mobile application, and deploy it on multiple platforms.

I created one simple app, and deployed the same on both android and iPhone, worked like a charm.

Visit phonegap.com and download, its FREE, read the instructions, that should get you going.

If you combine the power of PhoneGap and jQuery mobile, I bet you can develop nice UI as well as an application with a strong backend.

Recently heard that telerik has also launched an SDK Kendo UI, same concept, but like all telerik components its a paid product. visit kendoui.com

Share this:

Node.js (nodejs.org) is an event-driven I/O server-side JavaScript environment based on V8. It is intended for writing scalable network programs such as web servers. It was created by Ryan Dahl in 2009, and its growth is sponsored by Joyent, which employs Dahl.