Exemplo n.º 1
0
        public XmlDocument GetXmlDocumentResult()
        {
            XmlDocument xml = null;
            if (gsContentType == "text/html")
            {
                HtmlXml hx = new HtmlXml(new StringReader(gsTextResult));
                hx.ReadCommentInText = gbReadCommentInText;
                xml = hx.GenerateXmlDocument();
            }
            else if (gsContentType == "text/xml")
            {
                xml = new XmlDocument();
                xml.LoadXml(gsTextResult);
                //return xml;
            }
            else
                throw new PBException("Error can't transform \"{0}\" content to xml", gsContentType);


            if (gsTraceDirectory != null)
                gsXmlExportPath = GetNewHttpFileName(gsTraceDirectory, ".xml");
            else if (gsXmlExportPath != null)
            {
                if (cu.PathGetExt(gsTextExportPath) == "")
                    gsXmlExportPath = cu.PathSetExt(gsTextExportPath, ".xml");
            }
            if (gsXmlExportPath != null)
                xml.Save(gsXmlExportPath);
            return xml;
        }
Exemplo n.º 2
0
 public static XmlDocument LoadHtml(string sUrl)
 {
     HtmlXml hx = new HtmlXml(sUrl);
     return hx.GenerateXmlDocument();
 }