Overload FilterList() to simplify TEmbeddedArrayStackItem.CreateList()

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@707 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
inoussa
2009-02-14 02:10:55 +00:00
parent 856571eee4
commit 2073431adf
2 changed files with 7 additions and 5 deletions

View File

@ -2136,11 +2136,7 @@ end;
function TEmbeddedArrayStackItem.CreateList(const ANodeName: string): TDOMNodeList; function TEmbeddedArrayStackItem.CreateList(const ANodeName: string): TDOMNodeList;
begin begin
if ScopeObject.HasChildNodes() then begin if ScopeObject.HasChildNodes() then begin
{$IFDEF WST_DELPHI}
Result := FilterList(ScopeObject.ChildNodes,ANodeName);
{$ELSE}
Result := FilterList(ScopeObject,ANodeName); Result := FilterList(ScopeObject,ANodeName);
{$ENDIF WST_DELPHI}
end else begin end else begin
Result := nil; Result := nil;
end; end;

View File

@ -32,7 +32,8 @@ type
procedure ReadXMLFile(out ADoc: TXMLDocument; const AFilename: String);overload; procedure ReadXMLFile(out ADoc: TXMLDocument; const AFilename: String);overload;
function NodeToBuffer(ANode : TDOMNode):string ; function NodeToBuffer(ANode : TDOMNode):string ;
function FilterList(const ALIst : IDOMNodeList; const ANodeName : widestring):IDOMNodeList ;{$IFDEF USE_INLINE}inline;{$ENDIF} function FilterList(const ALIst : IDOMNodeList; const ANodeName : DOMString):IDOMNodeList;overload;{$IFDEF USE_INLINE}inline;{$ENDIF}
function FilterList(const ANode : TDOMNode; const ANodeName : DOMString):IDOMNodeList;overload;{$IFDEF USE_INLINE}inline;{$ENDIF}
implementation implementation
uses XmlDoc; uses XmlDoc;
@ -172,6 +173,11 @@ begin
Result := TDOMNodeSelectListImp.Create(ALIst,ANodeName); Result := TDOMNodeSelectListImp.Create(ALIst,ANodeName);
end; end;
function FilterList(const ANode : TDOMNode; const ANodeName : DOMString):IDOMNodeList;
begin
Result := FilterList(ANode.ChildNodes,ANodeName);
end;
{ TDOMNodeSelectListImp } { TDOMNodeSelectListImp }
constructor TDOMNodeSelectListImp.Create( constructor TDOMNodeSelectListImp.Create(