Archive for February, 2012

Reader Tip: Popular WordPress XML Sitemap Plugins

As mentioned in another post, adding an XML sitemap to your website is easy by visiting a sitemap creation website.  If you’re using the blogging platform WordPress, you can make this process even easier by installing an XML sitemap plugin.  A plugin will automatically refresh your XML sitemap when you make changes to your website, which is quite frequently if you are posting regular blog posts.

One of the most popular WordPress XML sitemap plugins is called Google XML Sitemaps.  You can find this on the WordPress.org site in their plugin directory.  With almost 3,000 user reviews, it’s the most popular and and well-known XML sitemap plugin.

To install, you simply need to download the .zip file, unzip it, and follow the instructions available in the readme.txt file in the .zip file.  Installation is easy and only takes about five minutes.  After you’ve installed it, you can manage it directly from your WordPress plugins folder.

(tip submitted by reader Jessica W. of The Ultimate http://growhairoil.com/ Resource)

Why XML Is The “Swiss Army Knife” Of Computer Language For The Internet

In this article I want to introduce the work of xmlarmyknife.org.  But first why is the site called XML Army Knife? Well we all know what a swiss army knife is right?  Its a pocket tool crammed full of useful gadgets such as a screw driver, knife, corkscrew, can opener, tweezers.  Some even have a magnifying glass, scissors and saw.  They have proved so useful and so versatile that the concept of a “Swiss Army Knife” has been applied to other fields (beyond hand tools and multi-tools).

When it comes to programming, I’d define XML as the “Swiss Army Knife” of computer language due to its versatility.  XML is actually a language within a language or more specifically a markup language that can be applied to practically any type of document.  It’s a lightweight language that strips things down to their basics.  This means it’s simple and easily understandable.  You don’t have to be a computer programming heavy weight to master XML.

Here are two examples of how XML is used on the web.

  • XML is the markup language of choice for real estate data.  All you need to do is to tag different data points to describe what they are.   THis then allows you to display the information in a useful format.  So the title of the property, before the price, before the property description for example.  And if all MLS systems use the same XML markup the data can be aggregated and compared making it more useful for real estate agents and investors alike.
  • The second example we have referred to in our introductory piece, but as it’s use is so widespread I thought I’d list it here aswell.  As website owners we want all the search engines to crawl our pages.  Given the complexity of some website structures it can be hard for these engines to effectively “spider” the entire site.  That’s where XML site maps using a special markup language come into play.

I could go on with more examples.  But I think I’ve made my point.  XML can be considered the “swiss army knife” of computer language for the web.

Common Uses Of XML

XML seems to be talked about a lot on the web these days but it is important to understand the instances and common uses for it today. Some examples of use are in database development, documentation and web development. With documentation many businesses are turning to Docbook as this is one of the most common XML platforms and allows for many of the different kinds of layouts  that are common in magazines, advertisements and books etc.

One of the next common uses is of XML in web development, XML technologies can help you future proof your website allowing you to change to future formats as they come about with ease. This is perfect for all types of site design whatever kind of site it may be. All sorts of websites are now making use of XML whether they’re discussing cake recipes or e cigarettes! The most important thing is that in using XML you are ensuring your data will always be accessible not just now but in the years to come.

SEO friendly XML sitemaps

Creating SEO friendly XML sitemap’s is a lot easier to do now than in the past due to the popularity of automation tools that do it all for you. There should be no reason why you shouldn’t have one for your website. Essentially XML sitemap’s are a map of your website for search engine crawlers to go through and recognize. By knowing how your files are structured and what links to what, search engines will have an easier time to index all your entire website and thus gain visibility and traffic.

I recently attended a convention and spoke to a representative of an seo agency. What he told me was quite interesting. Websites with SEO friendly url’s and sitemaps tend to have a larger reach as they start gaining traffic for long tail keywords. On the other hand, websites that do not have those foundations in place tend to do poorly in attracting new visitors. Even worse is that some websites takes several weeks in order for new content to be recognized and indexed by major search engines.

Many content management systems have an automated script that automatically creates the XML sitemap but if your looking to do it yourself, here’s how you go about it:

  1. Go to a XML sitemap creation website like http://www.xml-sitemaps.com/
  2. Fill in all the fields (Should take you 10 minutes maximum)
  3. Click the start button and your done!

Now that you have your sitemap, you can submit it to the various search engines like Google, Bing and Yahoo so that they can crawl your site better. At the same time you should leave a copy of the sitemap in your websites root folder for the crawlers to pick up. And that’s it, your done! Your website can now be easily indexed.

 

The Days Before XML

I remember building my first website back in 1995 I think it was. In those days there wasn’t much in the way of programs to help you and I bought a book about html and used the code to build my site. The site was a gift shop selling prints and other items with the customer’s family crest. Not many people had access to the internet then and shopping online was a luxury available to the few so, rather than being a business, the shop was more of a hobby.

Today there’s a multitude of choice. It is relatively cheap to buy a template that needs no knowledge of coding and which would look cutting edge. My family crests shop looks very different and online shopping is popular with the masses and is growing like a weed. Although there are now more languages with which to code, anyone wanting to build an internet based shop or a blog has no need for any codes; WordPress is available free of charge to all, and there are many similar formats.

The increased popularity of shopping online has brought with it a huge increase in potential customers. The problem is it has also lead to competition and there are now many online shops selling family crests similar to mine and the skill needed now is not how to build a website with html or any other language, but to appear relatively high in the search engines’ rankings.

Create an Image From XML Data

I had some time to kill and a silly problem to solve, which means here’s some more SimpleXML fun for you:

The Problem: It’s not really a “problem,” but FeedBurner’s FeedCountTM image is a rigid 88 pixels wide, and I wanted to include it on my homepage under the “syndicate” heading, an area that I’ve defined in my template as having only 80 pixels in width. The 88 pixels were throwing things off, so I used the width attribute of the HTML img tag to solve the problem. Unfortunately, it just squeezes the image, making the text in it appear fuzzy.

The Solution: FeedBurner conveniently provides what they call their “Awareness API,” which is a RESTful interface to retrieve (as XML data) the same exact information displayed in the FeedCountTM image. Since I wanted to maintain the same kind of image (because it’s a recognized look-and-feel for FeedBurner feeds), I simply fired up an image editing program, shuffled things around a bit until the image was a nice, clean 80 pixels wide, and saved it as the base image (shown to the right) I would use for generating an image similar to the one FeedBurner provides.

Then, I wrote a script to grab the FeedBurner data (using SimpleXML) and used PHP’s image functions to open the base image, write the FeedBurner circulation data to it, and save it to use on my site. I simply have a cron job that runs this script once a day to keep my image updated.

Here’s the code. Enjoy!

[code lang=“php”]
<?php
// Get the XML data from Feedburner
$sxe = new SimpleXMLElement(‘http://api.feedburner.com/awareness/1.0/GetFeedData?uri=ramsey’, NULL, TRUE);
$readers = (string) $sxe→feed→entry[‘circulation’];

// make sure it’s a number
$readers = is_numeric($readers) ? $readers : ‘0’;

// 39 is the base position; 6 the width of each char
$xpos = 39 – (strlen($readers) * 6);

// Create the image from the base image
$img = imagecreatefromgif(‘feedburner-base.gif’);
$color = imagecolorallocate($img, 0×00, 0×66, 0xCC);
imagestring($img, 2, $xpos, 2, $readers, $color);

// Save the image
imagegif($img, ‘feedburner-readers.gif’);
?>
[/code]

This is more or less same way in which QR Codes are generated.

Note that I determined the numbers used in lining up the text in the image by trial-and-error. I played around with it a bit to get things right. The $xpos variable is my attempt to right-align the text because you can only specify the left edge of the text with the x coordinate.

XML Web Services and Security

Because a large amount of web services are largely built on XML,  this has led to many new standards being developed in order to supply the basic security infrastructure to support it’s use.  Here is a quick list (which is by no means complete) of some developing technologies which may be of use to the reader.  It will hopefully flag up some further reading for any one new to XML development.

XML Signature – an XML specification for digital signatures.  These are essential to provide authentication, integrity of the message and of course non-repudiation.

XML Encryption – a companion to XML Signature – this addresses the need to encrypt and decrypt XML documents and sections of documents.

XML Key Management Specification (XKMS) – definition of messages and protocols for exchanging and distributing public keys.   It also has the facility to distribute these keys between unknown transaction clients.

Security Assertion Markup Language (SAML) – protocol for exchanging authentication and authorization information.

In addition to these important XML concepts, there are other technologies which should be considered.  For information and articles on security and anonymity particularly in large scale infrastructures – there is a lot of good advice particularly concerning proxies on this technology website – http://www.anonymous-proxies.org/ .

Other useful reading areas would be on more web technologies such as SOAP, WSDL and UDDI.   Although  these technologies all perform very useful services to any XML developer, they are particularly vulnerable to interception and eavesdropping attacks ‘on the wire’.   Because XML is often transmitted in clear text – SSL should be used for any private information.

Good Courses to Learn XML

I’m not a web designer but it is becoming apparently clear that I need to understand XML and HTML when I work on my company’s merchant account website. Even though I only have to make changes to the copy and head tags on the website, it would just make sense for me to know exactly what I’m doing. Usually when something more “difficult” pops up, I send it on to our in-house designer who knows how to hand code and understands the basics way better than I do.

Since I want to show that I am a valuable employee, I would like to be able to do the majority of the things the designer does (except designing logos and headers). I decided to start looking into taking some classes and “getting my knowledge on.” Of course, I started searching online hoping that I would get some good free information. Here’s what I found:

1. XML Tutorial at W3Schools.com: This is a free online tutorial and it looks pretty substantial. The website indicated to me that I need to have an understanding of HTML and JavaScript first. Yikes! I have a lot to learn.

2. XML Basics – An Introduction to XML at XMLFiles.com: It tells me that after studying the chapter presented on their site, I will know what the difference is between HTML and XML and that I will begin to know how to use XML. This sounds promising!

3. XML Tutorial at quackit.com: This site assures me that XML is easy to learn even if I don’t have much experience with HTML or databases (uh-oh, databases?) but the information will be easier to understand if I know both of these, as well as CSS. Ouch – I’ve just added another technology to my “need to learn” list!

I’ve determined that I need to delve into HTML, CSS, JavaScript, and XML and I am going to get as much as I can out of the free information online. Database technology might be something for the future, but we’ll see. I wish I had known at the age of 18 that I was going to love the internet this much. If I had, I would have received my degree in computer programming, not communication. Wish me luck!

The use of XML in modern webdesign

Over the last 10 years we have seen a lot of attempts to use XML based webdesign solutions, where people easily can modify their entire webdesign just by updating a few XML files. The point of these systems was to enable users with no knowledge of coding, HTML or design to easily change the look of their websites within certain limits. Most of these functions have now been moved to various CMS systems instead. However most of these systems turned out to be too complicated for most of the users or the possibilities was to limited to be of much use. Instead most of the webdesign features have now been moved to stylesheets which can easily be updated with little HTML knowledge. According to Michael from Webdesign won’t be seeing any new major XML based webdesign CMS systems in their future. However XML is still widely used in various Flash applications and will most likely still used for this in the next few years. For some reason flash never moved on to use stylesteets as most HTML based webdesigns did but instead kept the XML standard for those wishing to change the webdesign of their flash sites in an easy and simple way. With all the XML libraries for flash and seeing how Flash slowly being outfaced we can expect XML to still be a major factor with Flash for several more years to come.

With the introduction of HTML5 and flash becoming less and less popular we can expect to see fewer XML files in modern webdesign but that doesn’t mean the XML standard is dead, it is still widely used for many other applications such as config files, site maps and other places where structure is an important issue, but for pure webdesign it will be forgotten in the near future.

Understanding XML RSS Formatting

XML is often used for RSS feeds & syndication.

Generally RSS feeds are created in this format:

Ex:

<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
        <title>Heart Health</title>
        <description>How to live with a healthy heart.</description>
<link>Article's Site URL goes here</link>

        <item>
                <title>Becoming Heart Smart</title>
                <description>

Heart disease is the #1 cause of death as well as a major cause of disabling illness for women in the United States. Each year, approximately half a million women lose their life to cardiovascular disease. That number represents more deaths than the combined total of the next 7 leading causes of death in women! While death rates due to cardiovascular disease in men have declined in the last 20 years, the rates for women have increased. This unfortunate statistic is made even more frightening by the knowledge that  the consequences of heart disease for women tend to be more severe than they are for men. Research has demonstrated that 42% of women who suffer a heart attack will die within the first year as opposed to only 24% of men. Of those women who survive that first year, 33% of them will have a second heart attack within the next 6 year period. These statistics are even more harrowing for African-American women who are 70% more likely to die due to heart disease than Caucasian women of the same age.
Elevated blood pressure, elevated cholesterol levels, cigarette smoking, obesity, inactivity and diabetes have been identified as the 6 major risk factors for the development of heart disease. Happily, all of these factors can either be prevented or managed through lifestyle modifications such as quitting cigarette smoking, adhering to a heart-healthy diet, regular exercise, and in some cases medication for cholesterol and or blood pressure manaagement. Individual risk for heart disease varies based on a variety of factors such as a woman’s family history, ethnicity, and lifestyle. Contact your health care provider for a personal risk assessment and help devising a plan to ensure your future heart health.

</description>
<link>Article's URL goes here</link>
        </item>

</channel>
</rss>

Usually syndications output the title & the URL, sometimes they’ll show a part or all of the descriptions as well.

For instance:

This:

<item>
                <title>High Cholesterol Diet</title>
                <description>What to eat when you have high cholesterol.</description>
                <link>http://ldlhdlcholesterollevels.org/high-cholesterol-foods-to-avoid</link>
        </item>

Will likely show up like this:

High Cholesterol Diet