zoukankan      html  css  js  c++  java
  • Lazarus Reading XML- with TXMLDocument and TDOMNode

    这里读取'HistoryPath' ,'TracePath' 元素下的‘value’属性使用的是

    1. var  
    2.   xmlCfg: TXMLDocument;   
    3.   
    4. ....   
    5.        
    6. function ReadXMLCFG: boolean;   
    7. var  
    8. .....   
    9.   HistoryPath: string = '';   
    10.   TracePath: string = '';   
    11.   vChild: TDOMNode;   
    12. .....   
    13. begin  
    14.   Result := False;   
    15.   if ... then  
    16.   begin  
    17.      .....   
    18.       ReadXMLFile(xmlCfg, vCMSConfigXml);   
    19.       vChild := xmlCfg.DocumentElement.FirstChild;   
    20.       while Assigned(vChild) do  
    21.       begin  
    22.         if vChild.HasAttributes then  
    23.         begin  
    24.           eName := vChild.NodeName;   
    25.           if eName = 'HistoryPath' then  
    26.           begin  
    27.             HistoryPath := vChild.Attributes.GetNamedItem('value').NodeValue;   
    28.           end;   
    29.           if eName = 'TracePath' then  
    30.           begin  
    31.             TracePath := vChild.Attributes.GetNamedItem('value').NodeValue;   
    32.           end;   
    33.         end;   
    34.         vChild := vChild.NextSibling;   
    35.       end;   
    36.    .....   
    37.     end;   
    38.   end;   
    39. end;  
    
    
  • 相关阅读:
    day38 04-Spring加载配置文件
    day38 03-Spring的IOC和DI的区别
    day38 02-Spring快速入门
    关于mysql-connector-net在C#中的用法
    SQL的四种连接用法整理
    SQL的四种连接用法整理
    SQL的四种连接用法整理
    45道CSS基础面试题
    45道CSS基础面试题
    45道CSS基础面试题
  • 原文地址:https://www.cnblogs.com/hieroly/p/5201558.html
Copyright © 2011-2022 走看看