Okay I never professed to being a developer. I just like to dab in code and try to mimic the best practices I see out in the development community. That being said sometimes I am unable to find samples of what I am trying to accomplish. This was the case when I started writing the ConvertExtensions console application. So I figured it was worth mentioning it on my blog for the next poor soul who is trying to do something similar to what I am doing.
The pain was around reading the attribute of a XMLNode. This is probably second nature to a seasoned developer but for me it took several hours of searching to find the following code:
XMLDocument.SelectSingleNode(XMLNode[@AttributeName='"AttributeValue]");
So let me explain. The extensions.xml file has a XMLNode that looks like the following:
<ManagedExtension Name="BBCode">
Well it turns out that the value for ManagedExtension XMLNode is not BBCCode. The Name field is an attribute that has its own value. So to access this information you have to add the [attributeName=attributeValue] field to the call. Duh... Took forever to find sample code to do this.
If you want to see exactly how this looks in real life code then download the source code for the ConvertExtensions application and you can see how I used it to find all of the extension XMLNodes.