• R/O
  • SSH
  • HTTPS

akdf: Commit


Commit MetaInfo

Revision590 (tree)
Time2022-11-10 04:00:21
Authorderekwildstar

Log Message

Adicionada uma unit que contém funções utilitárias para o MSXML6
Ainda não foram gerados os projetos para todos os Delphi

Change Summary

Incremental Difference

--- trunk/rtp/prj/Delphi 26 (Delphi Rio)/KRKLib.dpk (revision 589)
+++ trunk/rtp/prj/Delphi 26 (Delphi Rio)/KRKLib.dpk (revision 590)
@@ -165,7 +165,8 @@
165165 KRK.Vcl.Dialogs in '..\..\src\Vcl\KRK.Vcl.Dialogs.pas',
166166 KRK.Vcl.Consts in '..\..\src\Vcl\KRK.Vcl.Consts.pas',
167167 KRK.Vcl.Dialogs.Editors in '..\..\src\Vcl\KRK.Vcl.Dialogs.Editors.pas',
168- KRK.Rtl.Sys.Console.Utils in '..\..\src\Rtl\Sys\KRK.Rtl.Sys.Console.Utils.pas';
168+ KRK.Rtl.Sys.Console.Utils in '..\..\src\Rtl\Sys\KRK.Rtl.Sys.Console.Utils.pas',
169+ KRK.Xml.MsXml6.Utilities in '..\..\src\Xml\KRK.Xml.MsXml6.Utilities.pas';
169170
170171 end.
171172
--- trunk/rtp/prj/Delphi 26 (Delphi Rio)/KRKLib.dproj (revision 589)
+++ trunk/rtp/prj/Delphi 26 (Delphi Rio)/KRKLib.dproj (revision 590)
@@ -190,6 +190,7 @@
190190 <DCCReference Include="..\..\src\Vcl\KRK.Vcl.Consts.pas"/>
191191 <DCCReference Include="..\..\src\Vcl\KRK.Vcl.Dialogs.Editors.pas"/>
192192 <DCCReference Include="..\..\src\Rtl\Sys\KRK.Rtl.Sys.Console.Utils.pas"/>
193+ <DCCReference Include="..\..\src\Xml\KRK.Xml.MsXml6.Utilities.pas"/>
193194 <BuildConfiguration Include="Base">
194195 <Key>Base</Key>
195196 </BuildConfiguration>
--- trunk/rtp/src/Xml/KRK.Xml.MsXml6.Utilities.pas (nonexistent)
+++ trunk/rtp/src/Xml/KRK.Xml.MsXml6.Utilities.pas (revision 590)
@@ -0,0 +1,51 @@
1+unit KRK.Xml.MsXml6.Utilities;
2+
3+interface
4+
5+uses
6+ KRK.Xml.MsXml6;
7+
8+function SelectXMLNode(AXMLRoot: IXMLDOMNode; const ANodePath: String): IXMLDOMNode;
9+function SelectXMLNodes(AXMLRoot: IXMLDOMNode; const ANodePath: String): IXMLDOMNodeList;
10+function ExtractXMLNode(AXML: String; const ANodePath: String): IXMLDOMNode;
11+function ExtractXMLNodes(AXML: String; const ANodePath: String): IXMLDOMNodeList;
12+
13+implementation
14+
15+uses
16+ Winapi.Windows;
17+
18+function SelectXMLNode(AXMLRoot: IXMLDOMNode; const ANodePath: String): IXMLDOMNode;
19+begin
20+ Result := AXMLRoot.selectSingleNode(ANodePath);
21+end;
22+
23+function SelectXMLNodes(AXMLRoot: IXMLDOMNode; const ANodePath: String): IXMLDOMNodeList;
24+begin
25+ Result := AXMLRoot.selectNodes(ANodePath);
26+end;
27+
28+function ExtractXMLNode(AXML: String; const ANodePath: String): IXMLDOMNode;
29+var
30+ XMLDOMDocument: IXMLDOMDocument3;
31+begin
32+ XMLDOMDocument := CoDOMDocument60.Create;
33+ XMLDOMDocument.setProperty('SelectionLanguage','XPath');
34+ if not XMLDOMDocument.loadXML(AXML) then
35+ OutputDebugString('erro');
36+
37+ Result := XMLDOMDocument.selectSingleNode(ANodePath);
38+end;
39+
40+function ExtractXMLNodes(AXML: String; const ANodePath: String): IXMLDOMNodeList;
41+var
42+ XMLDOMDocument: IXMLDOMDocument3;
43+begin
44+ XMLDOMDocument := CoDOMDocument60.Create;
45+ XMLDOMDocument.setProperty('SelectionLanguage','XPath');
46+ XMLDOMDocument.loadXML(AXML);
47+
48+ Result := XMLDOMDocument.selectNodes(ANodePath);
49+end;
50+
51+end.
Show on old repository browser