Monthly Archives: September 2008

use MXXMLWriter and SAXXMLReader to make a well formated xml file (indent)

Dim xmlDoc As New DOMDocument30 ‘Create the SAX reader. Dim rdr As New SAXXMLReader30 ‘Create the XML writer. Dim wrt As New MXXMLWriter30 ‘Load the DOM document. xmlDoc.async = False xmlDoc.Load App.Path & "\books.xml" ‘Set properties on the XML writer. … Continue reading

Posted in Code Snippets | Leave a comment

Convert Relative Paths to Absolute Using Regular Expressions

Convert Relative Paths to Absolute Using Regular Expressions public static String ConvertRelativePathsToAbsolute(String text, String absoluteUrl) { String value = Regex.Replace(text, "<(.*?)(src|href)=\"(?!http)(.*?)\"(.*?)>", "<$1$2=\"" + absoluteUrl + "$3\"$4>", RegexOptions.IgnoreCase | RegexOptions.Multiline); // Now just make sure that there isn’t a // because … Continue reading

Posted in Code Snippets | Leave a comment