當前位置: 首頁>>代碼示例>>C#>>正文


C# XmlTextReader.ReadOuterXml方法代碼示例

本文整理匯總了C#中System.Xml.XmlTextReader.ReadOuterXml方法的典型用法代碼示例。如果您正苦於以下問題:C# XmlTextReader.ReadOuterXml方法的具體用法?C# XmlTextReader.ReadOuterXml怎麽用?C# XmlTextReader.ReadOuterXml使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Xml.XmlTextReader的用法示例。


在下文中一共展示了XmlTextReader.ReadOuterXml方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Arcs

        /// <summary>
        /// Constructs the Arcs using Xml
        /// </summary>
        /// <param name="vsXml">Xml data</param>
        public Arcs(string vsXml)
        {
            XmlTextReader reader = new XmlTextReader(new StringReader(vsXml));
            reader.Read();

            ArcType = (EnumArcType)Enum.Parse(typeof(EnumArcType), reader.GetAttribute("arctype"));

            moArcList = new List<Arc>();

            while (reader.Read())
            {
                switch (reader.Name)
                {
                    case "Arcs" :
                        if (reader.NodeType != XmlNodeType.EndElement)
                        {
                            if (moInnerArcs == null)
                            {
                                moInnerArcs = new List<Arcs>();
                            }
                            moInnerArcs.Add(new Arcs(reader.ReadOuterXml()));
                        }
                        break;
                    case "Arc" :
                        moArcList.Add(new Arc(reader.ReadOuterXml()));
                        break;
                }
            }
        }
開發者ID:unityai,項目名稱:unityai-core,代碼行數:33,代碼來源:Arcs.cs

示例2: Listen

        private void Listen(object sender, DoWorkEventArgs e)
        {
            string url = @"http://" + _ipAddr.ToString() + "/PSIA/Metadata/stream?AreaControlEvents=true";
            credentialCache.Add(new System.Uri(url), "Basic", _credentials);

            _req = WebRequest.Create(url);
            _req.Credentials = credentialCache;
            _req.PreAuthenticate = true;

            HttpWebResponse response = (HttpWebResponse)_req.GetResponse();
            Stream responseStream = response.GetResponseStream();
            XmlTextReader reader = new XmlTextReader(responseStream);

            while (true)
            {
                reader.MoveToContent();
                string contents = reader.ReadOuterXml();

                if (OnEventRaised != null)
                {
                    BackgroundWorker worker = new BackgroundWorker();
                    worker.DoWork += new DoWorkEventHandler(worker_DoWork);
                    worker.RunWorkerAsync(contents);
                }

                reader.ResetState();
            }
        }
開發者ID:notaklingon,項目名稱:CInovonicsAR,代碼行數:28,代碼來源:InovonticsDevice.cs

示例3: DeserializeEdrmXml

        public EDRMEntity DeserializeEdrmXml(string filePath)
        {
            // create an xml reader.
            XmlReader reader = new XmlTextReader(new FileStream(filePath, FileMode.Open));

            // read through elements 
            while (reader.Read())
            {
                // parse document elements.
                if (reader.Name.Equals("document", StringComparison.InvariantCultureIgnoreCase))
                {
                    edrmEntity.BatchEntity.DocumentEntity.Add(ParseEdrmDocumentXml(reader.ReadOuterXml()));
                }

                if (reader.Name.Equals("relationship", StringComparison.InvariantCultureIgnoreCase))
                {
                    edrmEntity.BatchEntity.Relationships.Add(new RelationshipEntity()
                    {
                        Type = reader.SafeGetAttribute("Type"),
                        ParentDocID = reader.SafeGetAttribute("ParentDocId"),
                        ChildDocID = reader.SafeGetAttribute("ChildDocId")
                    });
                }
            }

            return edrmEntity;

        }
開發者ID:Rajeshbharathi,項目名稱:CGN.Paralegal,代碼行數:28,代碼來源:EdrmXmlDeserializer.cs

示例4: Execute

 public  async Task<int> Execute()
 {
     using (var reader = new StreamReader(FileName, Encode))
     {
         XmlReader xmlReader = new XmlTextReader(reader);
         xmlReader.ReadStartElement();
         while (xmlReader.Read())
         {
             var xdoc = new XmlDocument();
             string content = xmlReader.ReadOuterXml();
             if (string.IsNullOrEmpty(content))
             {
                 break;
             }
             xdoc.LoadXml(content);
             for (int i = 0; i < xdoc.DocumentElement.ChildNodes.Count; i++)
             {
                 var xele = xdoc.DocumentElement.ChildNodes[i] as XmlElement;
                 if (i != 0)
                 {
                     _logger.InfoLine(",");
                 }
                 _logger.InfoLine(xele.InnerText);
             }
             _logger.InfoLine("");
         }
         xmlReader.Close();
         return 0;
     }
 }
開發者ID:moonwa,項目名稱:moonlit.tools,代碼行數:30,代碼來源:Xml2Csv.cs

示例5: ConstructBody

        public string ConstructBody()
        {
            using (var reader = new XmlTextReader(new StringReader(page)))
            {
                reader.DtdProcessing = DtdProcessing.Ignore;
                reader.ReadToFollowing("body");

                return reader.ReadOuterXml();
            }
        }
開發者ID:Revelations,項目名稱:BaconApp,代碼行數:10,代碼來源:InfoPage.cs

示例6: RequestRestaurantInfo

        private static string RequestRestaurantInfo(string strURL)
        {
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(strURL);
            request.Method = "GET";
            HttpWebResponse response = (HttpWebResponse)request.GetResponse();

            Stream s = response.GetResponseStream();
            XmlTextReader reader = new XmlTextReader(s);
            reader.MoveToContent();
            string xml = reader.ReadOuterXml();
            return xml;
        }
開發者ID:juyingnan,項目名稱:VS,代碼行數:12,代碼來源:Test.asmx.cs

示例7: ConvertToXMLDoc

			public XmlDocument ConvertToXMLDoc(string xmlData)
			{
				
				XmlDocument xmlDoc = new XmlDocument();
				System.Xml.XmlTextReader xmlReader;
				xmlReader = new System.Xml.XmlTextReader(xmlData, System.Xml.XmlNodeType.Document, null);
				xmlReader.ReadOuterXml();
				xmlDoc.Load(xmlReader);
				
				return xmlDoc;
				
			}
開發者ID:avs009,項目名稱:gsf,代碼行數:12,代碼來源:BaseWebService.cs

示例8: CreateLookup

        public void CreateLookup(SPFeatureReceiverProperties properties, SPWeb web, String filePath)
        {
            string fieldId;
            bool isReading = true;
            XmlDocument document = GetXmlDocument(properties.Definition, filePath, web.Locale);

            using (XmlTextReader reader = new XmlTextReader(new StringReader(document.OuterXml)))
            {
                CreateListMapping(properties);
                while (true)
                {
                    if (reader.LocalName != "Field" || isReading)
                    {
                        if (!reader.Read())
                        {
                            break;
                        }
                    }
                    if (reader.LocalName == "Field")
                    {
                        if (reader.MoveToAttribute("Type") &&
                            reader.Value == "Lookup" &&
                            reader.MoveToAttribute("Name"))
                        {
                            fieldId = reader.Value;
                            if (lookupsListMapping.ContainsKey(fieldId))
                            {
                                String listName = lookupsListMapping[fieldId];
                                SPList list = GetListForLookup(listName, web);
                                reader.MoveToContent();
                                XmlDocument doc = new XmlDocument();
                                String fieldElement = reader.ReadOuterXml();
                                doc.LoadXml(fieldElement);
                                XPathNavigator navigator = doc.DocumentElement.CreateNavigator();
                                navigator.CreateAttribute("", "List", "", list.ID.ToString());

                                SPFieldLookup field = (SPFieldLookup)web.Fields[fieldId];

                                AddWebIdAttribute(web, doc);
                                field.SchemaXml = RemoveXmlnsAttribute(doc.OuterXml);

                                field.Update(true);
                                isReading = false;
                                continue;
                            }
                        }
                    }
                    isReading = true;
                }
            }
        }
開發者ID:oivoodoo,項目名稱:voo-university,代碼行數:51,代碼來源:LookupReciever.cs

示例9: makeJob

        public void makeJob()
        {
            if (languages.Count == 0)
            {
                scanLanguages();
            }

            using (reader = new XmlTextReader(path)) {
                while (reader.Read())
                {
                    if (reader.IsStartElement() && reader.LocalName == "tu")
                    {
                        XmlDocument xmlDoc = new XmlDocument();
                        xmlDoc.LoadXml(reader.ReadOuterXml());

                        foreach (XmlNode item in xmlDoc.FirstChild.ChildNodes)
                        {
                            if (item.LocalName == "tuv")
                            {
                                string lang;
                                if (null == item.Attributes["xml:lang"])
                                {
                                    lang = item.Attributes["lang"].Value;
                                }
                                else
                                {
                                    lang = item.Attributes["xml:lang"].Value;
                                }
                                int columnNumber = languages[lang];

                                foreach (XmlNode seg in item.ChildNodes)
                                {
                                    if (seg.LocalName == "seg")
                                    {
                                        foreach (XmlNode txt in seg.ChildNodes)
                                        {
                                            if (txt.NodeType == XmlNodeType.Text)
                                            {
                                                output.addCell(columnNumber, txt.Value);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        output.writeRow();
                    }
                }
            }
            output.Close();
        }
開發者ID:1Risha1,項目名稱:TmxToXlsx,代碼行數:51,代碼來源:TMXparser.cs

示例10: LoadXml

 /// <summary>
 /// Loads the nodes from Xml
 /// </summary>
 public void LoadXml(string vsFileName)
 {
     XmlTextReader reader = new XmlTextReader(vsFileName);
     while (reader.Read())
     {
         switch (reader.Name)
         {
             case "RuleBase":
                 if (reader.NodeType != XmlNodeType.EndElement)
                 {
                     CreateRulesBase(reader);
                 }
                 break;
             case "ContinuousRuleVariable":
                 CreateContinuousRuleVariable(reader.ReadOuterXml());
                 break;
             case "Rule":
                 //reader.ReadOuterXml();
                 CreateRules(reader.ReadOuterXml());
                 break;
         }
     }
     reader.Close();
 }
開發者ID:unityai,項目名稱:unityai-core,代碼行數:27,代碼來源:FuzzyController.cs

示例11: LoadSingleElement

 public void LoadSingleElement(string filename, XmlTextReader sourceReader) {
     _filename = filename;
     _lineOffset = sourceReader.LineNumber;
     string outerXml = sourceReader.ReadOuterXml();
     
     try {
         _reader = new XmlTextReader(new StringReader(outerXml), sourceReader.NameTable);
         base.Load(_reader);
     }
     finally {
         if (_reader != null) {
             _reader.Close();
             _reader = null;
         }
     }
 }
開發者ID:nlh774,項目名稱:DotNetReferenceSource,代碼行數:16,代碼來源:ConfigXmlDocument.cs

示例12: GetProductList

        public List<Product> GetProductList()
        {
            List<Product> list = new List<Product>();
            XmlTextReader reader = new XmlTextReader(dataFileName);
            reader.MoveToContent();
            XmlDocument doc = new XmlDocument();
            doc.LoadXml(reader.ReadOuterXml());
            XmlNodeList nodes = doc.SelectNodes("products/product");
            foreach (XmlNode node in nodes)
            {
                Product product = new Product(node.Attributes["id"].Value,
                                                node.Attributes["name"].Value,
                                                Convert.ToDouble(node.Attributes["price"].Value));
                list.Add(product);
            }
            reader.Close();

            return list;
        }
開發者ID:bnantz,項目名稱:NCS-V2-0,代碼行數:19,代碼來源:DataProvider.cs

示例13: BeliefNode

        /// <summary>
        /// Construct the Belief Node given the input Xml
        /// </summary>
        /// <param name="vsXml">Xml Data</param>
        public BeliefNode(string vsXml)
        {
            XmlTextReader reader = new XmlTextReader(new StringReader(vsXml));
            reader.Read();

            Name = reader.GetAttribute("name");
            PriorProbability = float.Parse(reader.GetAttribute("priorprob"));
            CurrentProbability = float.Parse(reader.GetAttribute("currentprob"));

            while(reader.Read())
            {
                switch (reader.Name)
                {
                    case "Arcs" :
                        moArcs = new Arcs(reader.ReadOuterXml());
                        break;
                }
            }
        }
開發者ID:unityai,項目名稱:unityai-core,代碼行數:23,代碼來源:BeliefNode.cs

示例14: ReadXmlFile

        internal string ReadXmlFile(string location)
        {
            TTE.Log(location);

            string xml;
            Match testHttp = Regex.Match(location, "^(http|https)://");

            if (testHttp.Success) {
                XmlTextReader oTR = new XmlTextReader(location);
                xml = oTR.ReadOuterXml();
            } else {
                StreamReader oSR = new StreamReader(location);
                xml = oSR.ReadToEnd();
                oSR.Close();
                oSR.Dispose();
                GC.Collect();
            }

            return xml;
        }
開發者ID:TycTak,項目名稱:TycTak,代碼行數:20,代碼來源:FileLibrary.cs

示例15: ProcessPages

        public void ProcessPages()
        {
            XmlTextReader reader = new XmlTextReader(this.InputStream);

            while (reader.Read())
            {
                switch (reader.NodeType)
                {
                    case XmlNodeType.Element:
                        if (reader.Name == "page")
                        {
                            PageProcessor.ProcessPage(reader.ReadOuterXml());
                        }
                        break;

                    default:
                        // Do nothing for now
                        break;
                }
            }
        }
開發者ID:heupel,項目名稱:WikipediaLoader,代碼行數:21,代碼來源:WikipediaXmlProcessor.cs


注:本文中的System.Xml.XmlTextReader.ReadOuterXml方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。