zoukankan      html  css  js  c++  java
  • 将xml绑定到gridview,及xml节点查询的selectNodes怎么实现多条件查询

    定义个model(datatable也可)

      XmlDocument   xmldoc   =   new   XmlDocument();   
      string   xmlstr   =   "<data   name="BackBtnResource1.Text"   xml:space="preserve">   
              <value>返回</value>   
              <comment>其它</comment>   
          </data>"   
      xmldoc.LoadXml(xmlstr);   
      XmlNodeList   list   =   xmldoc.SelectNodes("data");   
      ArrayList   datalist   =   new   ArrayList();   
      foreach(Xmlnode   node   in   list)   
      {   
          Model   m   =   new   Model();   
          m.attr   =   node.Attributes["name"].value;   
          xmlnode   subnode   =   node.SelectSingleNode("value");   
          m.val   =   subnode.innnertext;   
          subnode   =   node.SelectSingleNode("comment");   
          m.com   =   subnode.innnertext;   
          datalist.add(m);   
      }   
      gridview.datasource   =   datalist;   
      gridview.databind();

    xml节点查询的selectNodes怎么实现多条件查询

    XmlNodeList list = InvoiceXml.SelectNodes("LineItems/LineItem[ShippingAddressID='" + ShippingAddressID + "' and ShippingMethod='" + ShippingMethod + "' and ReqShipDate='" + ReqShipDate + "']")
  • 相关阅读:
    php 解析json
    TP学习笔记一(tp的目录结构 , tp的输出方式)
    linux android真机测试
    SharedPreferences保存数据
    Volley用法
    android获得图片
    android 一条线
    android 获取时间
    Android_Spinner_Listener
    Android_Spinner_SimpleAdapter
  • 原文地址:https://www.cnblogs.com/kofkyo/p/2297279.html
Copyright © 2011-2022 走看看