I have decided for some strange reason to start doing some geek type cartoons. I have been writing them for years but never thought I should put them up. After some encouragement by friends and colleagues I decided to. I make no apologies what so ever for my complete lack of drawing skills.
This first episode is in regards to everyone’s favorite company procedure “performance measurement”, enjoy! Continue reading
In this final installment of converting XML to JSON with XSL I will move outside of the ‘normal’ JSON conventions in order to provide data typing of returned values as well as flattening your resulting JSON for greater efficiency. Although naming conventions like BadgerFish provide for backwards conversion to XML it is often the case that this is not required. Conventions like BadgerFish also make the assumption that the source of the JSON may ‘not’ be safe and therefore all entities and corresponding values are encased as strings. Continue reading
I hate big words although I often as not use them. But I try to stick to English words that one would find in the dictionary not words one would only find in the User Manual to Client I.T. obfuscation!! It is true that when working with a client there has to be some sort of give and take on knowledge. As a developer we are beholden to learn their business and as a client they are beholden to learn some basic terminology of information technology . If this is not done then the lines of communication break down and the end result is a application that does not meet the client’s needs and or expectations. As illustrated by the below cartoon some words should simply not be used… Continue reading
In this installment of converting XML to JSON with XSL I will discuss escaping your resulting JSON plus the introduction of a config.xml file to drive your conversion. The config file becomes a necessity in order to do datatyping and character escaping. Continue reading
In my previous post on converting XML to JSON with XSL I mentioned that no one seemed to have done it. Well I made my initial search at the beginning of the year. Now when I search someone posted how to do it on there blog on January 21. Now I have to go through that implementation and see if it goes beyond my finished piece or has some nice ideas to add in.
Amazing how two people 6000 miles appart start working on the same thing at the same time. Believe there is a word for that but it fails me at the moment.
You can check out the implemenation at http://www.xml.lt/Blog/2009/01/21/XML+to+JSON.
A little while ago I was doing some playing around with Extjs and I found that the majority of the Ajax calls where expecting JSON back rather than XML. At this point I thought to myself ‘right then someone must have a converter out there in pure XSL. To my great surprise no one seems to either written one or made it public. So, based on this finding I think this will make an excellent, if long, first blog post.
The core idea for the converter is to use only the basic functionality provided in XSL. This means no library/namespace extensions. This will provide for the transformer to be portable across all major web platforms, such as JAVA, PHP, CFM and of course .NET.
For the purpose of this post I will use a simple XML file with some basic content as the example. I will lay out the creation of the transformer as I wrote it. I will use the JSON Badgerfish convention and later in the post show how to deviate from it and why. At the end of the post I will cover the introduction of a config.xml file to drive the transformations. The actual server side transformation will be covered lastly and will be in VB.NET and C#. Continue reading