コード例 #1
0
ファイル: RenderXmlToHtml.cs プロジェクト: rbramwell/OrionSDK
        /// <summary>
        /// This method has to use the old XSL Processor because of the fact that the
        /// http://www.w3.org/TR/WD-xsl namespace is unsupported.
        ///
        /// The simplest way was to use the old xsl instead of re-inventing the wheel.
        /// I could not find a way to easily fully convert this to XSLT 1.0 due to 
        /// the lack of namespace and cdata 'selectability'.
        ///
        /// This brings back memories :)
        /// </summary>
        /// <param name="xmlToRender">the xml string to render</param>
        /// <returns>HTML string</returns>
        internal static string Render(string xmlToRender)
        {
            XSLTemplate oXSLT;
            FreeThreadedDOMDocument oStyleSheet;
            IXSLProcessor oXSLTProc;
            DOMDocument oXMLSource;

            try
            {
                oXSLT = new XSLTemplate();
                oStyleSheet = new FreeThreadedDOMDocument();
                oXMLSource = new DOMDocument();

                oStyleSheet.async = false;
                oStyleSheet.loadXML(XmlRender.XMLToHTML);

                oXSLT.stylesheet = oStyleSheet;

                oXSLTProc = oXSLT.createProcessor();

                oXMLSource.async = false;
                oXMLSource.loadXML(xmlToRender);
                oXSLTProc.input = oXMLSource;

                oXSLTProc.transform();

                return oXSLTProc.output.ToString();
            }
            catch (Exception e)
            {
                return e.Message;
            }
            finally
            {
                oXSLT = null;
                oStyleSheet = null;
                oXMLSource = null;
                oXSLTProc = null;
            }
        }
コード例 #2
0
ファイル: jQuery.cs プロジェクト: wooboo/lunchhunters
 public static extern jQuery.Elements jQuery(string html, DOMDocument ownerDocument);
コード例 #3
0
        public NetUserInfo()
        {
            //initialize Object
            //Get net info
            const string apiUrl = "http://ipinfodb.com/ip_query.php";
            var httpClient = new WebClient();
            try
            {
                string response = httpClient.DownloadString(apiUrl);
                var xmlResponse = new DOMDocument();
                xmlResponse.loadXML(response);
                const string r = " ";

                _xmlContent = xmlResponse.text.Split(r.ToCharArray());
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #4
0
ファイル: jQuery.cs プロジェクト: wooboo/lunchhunters
 public static extern jQuery.Elements jQuery(DOMDocument document);