易截截图软件、单文件、免安装、纯绿色、仅160KB

一些工具函数 Xml 序列化

  public sealed class XmlHelper
{
public static void Serialize<T>(T obj,string fileName)
{
TextWriter writer = new StreamWriter(fileName);
try
{
XmlSerializer ser = new XmlSerializer(typeof(T));
ser.Serialize(writer, obj);
}
catch (Exception)
{
throw;
}
finally
{
if (writer != null)
{
writer.Close();
}
}
}
public static T Deserialize<T>(string fileName) where T:class
{
TextReader reader = new StreamReader(fileName);
T newObj ;
try
{
XmlSerializer mySerializer = new XmlSerializer(typeof(T));
newObj= mySerializer.Deserialize(reader) as T;
}
catch (Exception)
{
throw;
}
finally
{
if (reader != null)
{
reader.Close();
}
}
return newObj;
}
public static T Deserialize<T>(FileInfo file) where T : class
{
string fileName = file.FullName;
return Deserialize<T>(fileName);
}
}


相关文档:

数据库批量更新,添加!有关XML的操作

得到一个需要处理的XMl
  private string GetSaveItem()
{
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml("<menuCollection/>");
foreach (TreeNode node in trvAccessRight.CheckedNodes)
{
if (node != trvAccess ......

XML ,query 和 value是区分大小写 的

DECLARE @x xml
SET @x='
<root>
  <ShopAccount>
    <ActivityType>IA - PM Standing WO (for LPI report)</ActivityType>
    <ProjectNo>R</ProjectNo>
  </ShopAccount>
  <ShopAccount>
    ......

java创建Xml笔记


用java创建Xml的4大类:
 
Element:节点类
Attribute属性类
Document:指的就是文档类
XMLOutput:输出类
此类是用java建立一个xml文件
 
public class TestJdom {
    //创建XML(模型)dom
    public static void main(String[] args) {
     ......

10本经典XML及Web相关电子书


XML How to Program

Beginning Xml Databases

Beginning XSLT and XPath Transforming XML Documents and Data

ASP.NET 2.0 XML

XML 手册 4th Edition

XML Schema Complete Reference
......

如何 使用 java 操纵 XML 文件


Introduction to XML and XML With Java  
 
If you are looking for sample programs to parse a XML file using DOM/SAX parser or looking for a program to generate a XML file please proceed directly to programs.
This small tutorial introduces you to the basic concepts of XML and using Xer ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号