首页 新闻 会员 周边 捐助

谁给我一些关于XML基本操作方面的材料?

0
[已解决问题] 解决于 2007-11-26 19:19
我想学一下对XML文档的基本操作。比如说往节点中写值,读值等。以及查询某个节点等一些基本的操作。<BR><BR>谁给我一些学习资源?有的话给我发到邮箱中<A href="mailto:hanxianlong888@163.com"><FONT color=#0000ff>hanxianlong888@163.com</FONT></A>,或者是直接给我一个相关资源的链接也可以。<BR>要是您有一些小事例那就更好了!<BR><BR>非常感谢您! <BR><BR>允许转载,麻烦注明出处:<A href="http://www.cnblogs.com/hanxianlong"><FONT color=#800080>http://www.cnblogs.com/hanxianlong</FONT></A>
是谁啊?的主页 是谁啊? | 菜鸟二级 | 园豆:339
提问于:2007-11-19 19:09
< >
分享
最佳答案
0
刚写的,Rss2.0输出,用XmlTextWriter完成,贴给你 V_UserGirlPhotos[] photos = gatway.From<V_UserGirlPhotos>() .OrderBy(V_UserGirlPhotos._.DateCreated.Desc).ToArray<V_UserGirlPhotos>(100); XmlTextWriter writer = new XmlTextWriter(MapPath("~/rss.xml"), System.Text.Encoding.UTF8); writer.Indentation = 3; writer.Formatting = Formatting.Indented; writer.WriteStartDocument(true); writer.WriteStartElement("rss"); writer.WriteAttributeString("version","2.0"); writer.WriteStartElement("channel"); writer.WriteStartElement("title"); writer.WriteString("Girls2You.Com RSS"); writer.WriteEndElement(); writer.WriteStartElement("link"); writer.WriteString("http://ww.girls2you.com"); writer.WriteEndElement(); writer.WriteStartElement("description"); writer.WriteString("desc"); writer.WriteEndElement(); foreach (V_UserGirlPhotos p in photos) { writer.WriteStartElement("item"); writer.WriteStartElement("title"); writer.WriteCData(p.Title); writer.WriteEndElement(); writer.WriteStartElement("link"); writer.WriteCData("http://www.girls2you.com/detail.aspx?ID=" + p.ID); writer.WriteEndElement(); writer.WriteStartElement("description"); string src = "<img src='" + SiteConst.WEBSITE + ResolveUrl(p.LargeImageUrl) + "' border='0' />"; writer.WriteCData(src + "<div>Tags:" + p.RssLinkTags + "</div>"); writer.WriteEndElement(); writer.WriteElementString("pubDate", p.DateCreated.ToString()); writer.WriteEndElement(); } writer.WriteEndElement(); writer.WriteEndElement(); writer.WriteEndDocument(); writer.Close(); Response.Redirect("rss.xml",true);
永不言败 | 菜鸟二级 |园豆:350 | 2007-11-20 15:39
其他回答(3)
0
请访问我的博客,http://lijigang.cnblogs.com/,从这里看http://www.cnblogs.com/lijigang/archive/2006/10/30/544046.html
刚刚 | 园豆:3151 (老鸟四级) | 2007-11-19 19:39
0
MSDN啊
麒麟.NET | 园豆:3614 (老鸟四级) | 2007-11-19 23:27
0
帮助文档里面有好多,可以看看。
mjgforever | 园豆:335 (菜鸟二级) | 2007-11-20 18:51
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册