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

把datatable里的数据转换成xml格式的字符串

string GetXmlByDataTable()
    {
        string xmlstr;
        string sql = "select top 10 * from BasicInfo";
        DataTable dt = idb.ReturnDataTable(sql);
        dt.TableName = "tbname";
        if (dt.Rows.Count>0)
        {
            System.IO.StringWriter writer = new System.IO.StringWriter();
            dt.WriteXml(writer);
            xmlstr = writer.ToString();
        }
        return xmlstr;
    }


相关文档:

使用Velocity+zip+xml快速构建word2007文档

技术介绍
     在一般的Java项目中,生成word文档的时候,我们会使用到jacob来作为我们生成word文档的工具,但是jacob是通过使用JNI调用dll文件来实现,这样的工作方式带来了极大的性能开销.这里我们采用Velocity+zip+xml快速构建word2007文档,所以说这个技术实现有一定的局限性,生成的必须是word2007文档 ......

XML 实体引用

在 XML 中,一些字符拥有特殊的意义。
如果你把字符 "<" 放在 XML 元素中,会发生错误,这是因为解析器会把它当作新元素的开始。
这样会产生 XML 错误:
<message>if salary < 1000 then</message>
为了避免这个错误,用一个实体引用来代替 "<" 字符:
<message>if salary < 1000 then ......

JAVA对象转换为XML格式

JAVA对象转换为XML格式
    简单的颤述下如何将JAVA对象转换为XML格式,详细了解请进入http://xstream.codehaus.org/tutorial.html
  
 JAVABEAN对象
 
  userInfo.java
         private String name;
   & ......

Integration with the XML Data Type

Integration with the XML Data Type
With the introduction of the XML data type, we wanted to also give FOR XML the ability to generate an instance of XML directly (more precisely, it generates a single row, single column rowset where the cell contains the XML data type instance).
Because of the bac ......

xml和java Bean的直接转换,Xmap

package test;
import java.util.ArrayList;
import java.util.List;

import org.nuxeo.common.xmap.annotation.XNode;
import org.nuxeo.common.xmap.annotation.XNodeList;
import org.nuxeo.common.xmap.annotation.XObject;


/**
* Book 实体对象,此处用XMap注解
* @author Administra ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号