Aug 18, 2009 at 8:59 PM
Edited Aug 19, 2009 at 6:42 AM
I'm currently moving to Oxite from a home grown blogging engine I wrote years ago. I wrote my own BlogML exporter to speed things up.
The BlogML I produced had a lot of problems, which I've now figured out by stepping through the BlogMLSave action method.
I've a few suggestions that could help make the error detection and messages better.
Although hopefully most people won't have the BlogML problems I've had, because they won't be writing their own blogML.
1. Badly formed XML
If there is a problem with the XML an exception is thrown and it is caught by this bit of code, which I modified slightly to give a more helpful warning in my case.
catch (Exception ex)
I think it should be possible to use the information in the exception to give a very useful error message that shows a snippet of your XML where the problem is.
2. Missing <![CDATA[ --- ]]> tags in content
I missed off these tags and it caused the import to wrongly report it had been successful.
The missing CDATA tags caused blogMLPost.Content.Text to be empty in the imported XML.
This line checks for blank title and content and proceeds to the next post if either are blank:
It should also keep track of how many posts haven't been imported and report this as an error.
if (string.IsNullOrEmpty(blogMLPost.Title) || string.IsNullOrEmpty(blogMLPost.Content.Text))
Hope that's helpful. Loving Oxite and MVC. Keep up the good work.