XMDP and C#

If you've done any sort of web development, you've most likely used the meta tag. You've probably put in there the copyright info, who created the document, basically Google/other crawler specific info for the most part as no one really reads it. Its purpose in everything though is to give meta information to some program. However, what if you wanted to have meta information within the web page itself (think Microformats)? It's possible, use rel, class, id, etc. to define items that are of a specific type and use CSS to make it look decent. However no one will know what those tags mean and no computer will know what they are. Thus they'll be ignored. So how could you define these items in a document that could be shared and read by both a human and a machine? Well that's where XMDP comes in.

 XMDP, or XHTML Meta Data Profile, is a very simple format that can be used to define the meta data that are used on your pages. It's been used for pretty much all of the various microformats out there (hCard for example). So it is in use and like I said it's extremely simple (it's basically just a dictionary pairing of items and their descriptions using dl, dt, and dd). And to make your lives even easier when it comes to creating XMDP pages, I've created a couple of classe to help you out:

XMDP.zip (1.22 kb)

Just two classes, each is documented, etc.  So give it a try, leave feedback, and happy coding.

kick it on DotNetKicks.com   Shout it
Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkListEmail

Posted by: James Craig
Posted on: 10/31/2008 at 9:54 AM
Tags: ,
Categories: C# | Web Design
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

APML in C#

APML stands for Attention Profiling Markup Language. If you've never heard of it, I'm not that shocked. It's one of those formats that is a fantastic concept but hasn't caught on 100% at this point. At the same time though, it's gaining some steam. So if that doesn't interest you, lets talk about what it actually does...

The concept behind APML is this, you have preferences when it comes to what you read (some that you realize and some that you don't). Going to websites should allow you to easily find this information but at present it's not that great. I mean even searching on Google takes a bit of work sometimes. So what if you could share a small bit of information with websites and let them sort their information so that what you want is what you see? That's what APML does (well sort of anyway). Really it's just a XML format that ranks phrases/words on a percentage basis (based on personal preferences), some of the info is defined by the user and some is defined by other items (RSS feeds, applications that you use, etc.).

Now that you've read about the format (by the way, definitely go to the APML website that I linked to above as they explain it better than myself), I'm sure that you've come up with a few ways to use the format. And most likely you want some code to create APML files of your own (and since you're here you most likely want it in C#). Therefore, here you go:

APML.zip (9.73 kb)

This one is similar to my OPML and RSS helpers. You can either load an APML file by stating the location of the file, loading an XML document, or doing so by hand and simply call ToString and it will give you a properly formatted APML file. It's commented and shouldn't be too difficult to use but definitely look at the format itself as items are named the same as in the format itself. Anyway, download the code, try it out, leave feedback, and happy coding.

kick it on DotNetKicks.com   Shout it
Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkListEmail

Posted by: James Craig
Posted on: 10/28/2008 at 7:39 PM
Tags: , ,
Categories: ASP.Net | C# | Web Design
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

FCKEditor and ASP.Net Fix

I'm not sure I'd call this a fix, more of an addition. Anyway, I've talked a couple of times about things that need to be changed with regard to the .Net Control that they have every once in a while. This time around it was more of an annoyance of mine. You see, I like to have a very well defined directory structure for my uploads. Images go in the images directory, etc. This works fine with FCK, as it puts images, media, flash files, etc. all in different folders. However, I like to take things further and divide things based on entries/pages. So for instance, I would prefer to have this post use a different directory for uploads and another post use a different directory. With FCK this is a pain to do but it's doable. You simply switch the FCKeditor:UserFilesPath application setting to the directory that you want. I find that annoying though. So instead I recommend the following function:

        [DefaultValue("/uploads/")]
        public string UploadPath
        {
            get
            {
                object o = ViewState["UploadPath"];

                if (o == null)
                    o = System.Configuration.ConfigurationSettings.AppSettings["FCKeditor:UserFilesPath"];

                return (o == null ? "/uploads/" : (string)o);
            }
            set { ViewState["UploadPath"] = value; System.Configuration.ConfigurationSettings.AppSettings["FCKeditor:UserFilesPath"] = value; }
        }

Add that function to the FckEditor class in the FCK Control (FCKeditor.cs file)... All that function does, is allows you to programmitcally change the FCK editor's upload location on the object itself. It's rather basic but has been annoying the heck out of me for a little bit now. In theory they're working on improving this but in the mean time, you might as well just add the function above. Anyway, it might not be the most useful bit of code but it annoyed me to no end for a day or two so I figured I'd share. So try it out, leave feedback, and happy coding.

kick it on DotNetKicks.com   Shout it
Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkListEmail

Posted by: James Craig
Posted on: 10/27/2008 at 1:14 PM
Tags: ,
Categories: ASP.Net | Web Design
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed