由买买提看人间百态

topics

全部话题 - 话题: xelement
(共0页)
c**t
发帖数: 2744
1
来自主题: DotNet版 - Converting a CSV file to XML using LinQ
using System;
using System.Query;
using System.Xml.XLinq;
using System.IO
namespace LinqToXmlSample.FlatFileToXml
{
class Program
{
static void main(string [] args)
{
XElement xml =
new XElement("books",
from line in File.ReadAllLines("books.txt")
where !line.StartsWith("#")
let items = line.Split(',')
select new XElement("book",
new XElement("title", items[1]),
new XElement("authors",
from authorFullName in items[2].Split(';')
let authorNameParts =
j******u
发帖数: 1968
2
你老吴阶了,现在我还要说,凡宇宙不是我的马家,使我和xiaok/马xelement共享的id
(共0页)