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

通过LINQ to XML生成 XML

标签:数据访问     ADO.NET
     通过LINQ to XML生成 XML     XML常常用语在客户机和服务器之间交流数据,或者多层应用程序之间交流。
    用LINQ to SQL查询数据,再用LINQ to XML吧数据转换为XML.
    例:
        .......
        AreslabDataContext aresData = new aresData();    //创建DataContext实例
        XElement aresCustomerOrders = new XElement("customers",    //创建XML片段实例                       from c in aresData.Customers            //利用LINQ查询数据,DataContext对象的Customers成员作为数据源                       select new XElement("customer",        //构建select投射                                       new XAtrribute("ID", c.CustomerID),                                       new XAtrribute("Company", c.CompanyName),                                           


相关文档:

在XML中定义菜单

和Android UI layout一样,我们也可以在XML中定义应用程序的菜单。通过在菜单的onCreateOptionsMenu方法中膨胀菜单layout。这样做会使我们的程序代码简单多了,而且尽可能的将更多的界面设计部分放到XML,便于浏览。
 
1. 在工程的/res/文件夹下创建menu文件夹,用来保存你为应用程序定义的菜单XML文件。
在菜单XML ......

Linq to XML customize distinct function

Definition comparer class,
class ItemComparer : IEqualityComparer<XElement>
{
public bool Equals(XElement x, XElement y)
{
return x.Attribute("Name").Value == x.Attribute("Name").Value;
}
public int GetHashCode(XElement obj)
......

php数据库导出类 导出JSON,XML,WORD,EXCEL

from:http://www.xland.com.cn/article/7/81/0804/28778.htm
本类实现:
数据库信息导出:word,excel,json,xml,sql
数据库恢复:从sql,从文件
具体用法:
首先新建测试用数据库mytest,然后在里面建张表
PHP代码:
以下是代码片段:
--
-- 表的结构 `test`
--
CREATE TABLE `test` (
   `id ......

DOM4J生成XML文档


public int createXMLFile(String filename) {
  int returnValue = 0;
  Document document = DocumentHelper.createDocument();    //生成Document,用于管理XML文档
  
  Element booksElement = document.addElement("books");    //添加 ......

怎么样在网页上读取远程xml的数据

 本文转自:http://www.10086web.com/html/wangluobiancheng/Xmlbiancheng/2009/0612/90.html
一个客户提供一个股价的信息,要求放在页面上,显示一些数据,需要从远程获取xml,然后解析写在网页上,开始不会觉得很难,其实蛮简单的,先用javascript写了一个:
<mce:script language=javascript><!--

......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号