Click here to Skip to main content
15,895,836 members
Articles / Programming Languages / C#

SQLDoc Sharp

Rate me:
Please Sign up or sign in to vote.
3.91/5 (9 votes)
23 Apr 2009CPL2 min read 96.7K   3.4K   40  
SQLDoc Sharp, an interactive tool designed to generate the SQL Server 2005/2008 documentation.
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.Xml.Xsl;
using System.Xml.XPath;
using System.IO;  

namespace SQLDocGenerator
{
    class HTMLTransfomer
    {
        private string _xmlfile = string.Empty;
        private string _xslFile = string.Empty;
        private string _htmlFile = string.Empty;

        public HTMLTransfomer(string xmlfile, string xslFile, string htmlFile)
        {
            _xmlfile = xmlfile;
            _xslFile = xslFile;
            _htmlFile = htmlFile;
        }

        public void TableTransformer()
        {
           
            XmlTextReader xmlSource = new XmlTextReader(@"xml\" + _xmlfile);
            XPathDocument xpathDoc = new XPathDocument(xmlSource);

            XmlTextReader xslSource = new XmlTextReader(@"xsl\" + _xslFile);
            XslCompiledTransform xsltDoc = new XslCompiledTransform();

            xsltDoc.Load(xslSource);

            StringBuilder sb = new StringBuilder();
            StringWriter sw = new StringWriter(sb);

            XsltArgumentList ar = new XsltArgumentList();

            xsltDoc.Transform(xpathDoc, null, sw);

            File.WriteAllText(@"html\" + _htmlFile, sb.ToString());
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Common Public License Version 1.0 (CPL)


Written By
Architect
India India
An engineer with approx. 8 years of excellent experience in middle tier applications, analysis, design, development, testing, and maintenance of various client server/web based applications. Has the ability to handle multiple task(s), work independently as well as in team. Motivated, energetic with demonstrated proficiency for learning new technologies and business environments to provide effective and efficient IT solution(s) that envisage a futuristic approach with distributed and object oriented technologies.

Comments and Discussions