zoukankan      html  css  js  c++  java
  • DELPHI之备忘四

    1. XML文件操作中的selectNodes使用的是Xpath语法,可以参考:http://www.w3school.com.cn/xpath/index.asp

       例如这样的选择语法:selectNodes('//data/r[contains(@reportType,"季报") and (@reportType != "三季报")]')

       这样{‘年报’,‘中报’,‘一季报’,‘第二季报’,‘第三季报’,‘第四季报’,‘三季报’}

       中只会选择{‘一季报’,‘第二季报’,‘第三季报’,‘第四季报’}的节点

    代码
    //DataSetXPath := '//data/r[@reportType!="第三季报" and @reportType!="第二季报" and @reportType!="第四季报"] ';
    //DataSetXPath := '//data/r[@reportType="年报"]|//data/r[@reportType="中报"]|//data/r[@reportType="一季报"]|//data/r[@reportType="三季报"]';
    DataSetXPath := '//data/r[(6 mod string-length(@reportType))=0]';

    不过速度没有直接一个条件或者判断来得快,而且“<"">"号好像都会有问题,“!=”不能用于比较数值?

    2.关于Tstrings调试时注意不能用Tstrings.text来查看debug内容,Tstrings.text显示的内容会有大小限制,要一行一行显示

    3. Delphi调用WebServices的接口中需要注意加一句,如下的红字,否则传递参数会无法上传至服务器

    initialization

      InvRegistry.RegisterInterface(TypeInfo(CustomerServiceSoap), 'http://www.XXX.com.cn/', 'utf-8');
      InvRegistry.RegisterInvokeOptions(TypeInfo(CustomerServiceSoap), ioDocument);
      InvRegistry.RegisterDefaultSOAPAction(TypeInfo(CustomerServiceSoap), 'http://www.XXX.com.cn/GetUserType');

  • 相关阅读:
    C#网络编程系列(两)它Socket同步TCPserver
    [LeetCode] ZigZag Conversion [9]
    设计模式迭代器模式
    Android_WebServices_介绍
    (UML两个汇总)九种图。
    你不明白 String 类别
    Mockito使用注意事项
    Xcode6为什么干掉pch(Precompile Prefix Header)&amp;怎样加入pch文件
    atoi()函数的实现
    多种方法求解八数码问题
  • 原文地址:https://www.cnblogs.com/enli/p/1764631.html
Copyright © 2011-2022 走看看