Popular Posts
javax.net.ssl.SSLHandshakeException: Connection closed by peer in Android 5.0 Lollipop Recently, there is a error occurs when access website via ssl connection like below although it worked fine several days ago. // Enable SSL... Tired of Hibernate? Try JDBI in your code JDBI Quick sample ICategoryDAO.java : create a data access interface (implement is not required) package com.prhythm.erotic.task.data.... Enable SSL connection for Jsoup import org.jsoup.Connection; import org.jsoup.Jsoup; import javax.net.ssl.*; import java.io.IOException; import java.security.KeyManagement...
Blog Archive
Stats
Memorize xml document operation
I have not write codes about operating xml document by C# for months. Almost forget all...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.IO;
using Sportingbet.net;
using Sportingbet.util;
using System.Xml.Linq;
using System.Xml.XPath;
using System.Xml;

class Program
{
    static void Main(string[] args)
    {
        string xml = File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + "tmp.xml");
        XDocument xDoc = XDocument.Parse(xml);
        var nodes = from e in xDoc.XPathSelectElements("//myTag")
                    select e;
        foreach (var e in nodes)
        {
            Console.WriteLine(e);
        }

        XmlDocument xmlDoc = new XmlDocument();
        xmlDoc.LoadXml(xml);
        XmlNodeList nodelist = xmlDoc.SelectNodes("//myTag");
        foreach (XmlNode e in nodelist)
        {
            Console.WriteLine(e.OuterXml);
        }
    }
}