Registriert seit: 6. Apr 2005
10.109 Beiträge
|
Re: Teilstring in Textdatei ändern
19. Mai 2006, 14:49
Kurz vor dem Abtauchen noch das hier:
Delphi-Quellcode:
uses
XMLIntf,
XMLDoc;
function XMLChange(markup, ePath, aName, oldValue, newValue: String): String;
var
doc: IXMLDocument;
nl: IDOMNodeList;
e: IDOMElement;
i: Integer;
s: String;
begin
doc := LoadXMLData(markup);
with doc.DOMDocument as IDOMNodeSelect do
nl := SelectNodes(ePath);
for i := 0 to Pred(nl.length) do
begin
e := nl.item[i] as IDOMElement;
s := e.getAttribute(aName);
if CompareText(s, oldValue) = 0 then
e.setAttribute(aName, newValue);
end;
Result := doc.XML.Text;
end;
marabu
|
|
Zitat
|