Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   XML (https://www.delphipraxis.net/46-xml/)
-   -   Delphi IXMLNode.NextSilbing() und angebliche Exception (https://www.delphipraxis.net/178668-ixmlnode-nextsilbing-und-angebliche-exception.html)

Der schöne Günther 20. Jan 2014 17:11

IXMLNode.NextSilbing() und angebliche Exception
 
Ich habe weiterhin Hoffnung dass die Dokumentation nicht voller Fehler ist, sondern ich sie falsch verstehe. Die Dokumentation zu IXMLNodeList.NextSilbing() spricht:
Zitat:

NextSibling returns the node that follows this one in the parent node's ChildNodes property list.

If this node is the last node in its parent's child list, NextSibling raises an exception.
Das ist tatsächlich aber überhaupt nicht der Fall: Es kommt, wie es auch vernünftig wäre,
Delphi-Quellcode:
nil
heraus und gut ist. Zur Sicherheit noch der entsprechende Quelltext der Klassen:

Delphi-Quellcode:
function TXMLNode.NextSibling: IXMLNode;
begin
  if Assigned(ParentNode) then
    Result := ParentNode.ChildNodes.FindSibling(Self as IXMLNode, 1) else
    Result := nil;
end;
und

Delphi-Quellcode:
function TXMLNodeList.FindSibling(const Node: IXMLNode; Delta: Integer): IXMLNode;
var
  Index: Integer;
begin
  Index := IndexOf(Node);
  Index := Index + Delta;
  if (Index >= 0) and (Index < list.Count) then
    Result := Get(Index) else
    Result := nil;
end;
Warum redet die Hilfe hier von einer Exception? Ich verstehe das nicht. Auch in der Microsoft-Dokumentation zu MSXML steht davon nichts.

himitsu 20. Jan 2014 17:30

AW: IXMLNode.NextSilbing() und angebliche Exception
 
Abgesehn davon, daß du in der falschen Hilfe gelandet bist.
Und dort könnte ja wirklich mal eine Variante sein, welche das so implementiert hat/hatte.

richtig: http://docwiki.embarcadero.com/Libra...de.NextSibling
Aber dort steht es auch so aus.

Vielleicht noch ein alter/falscher Hilfetext, welchen dort die Automatik übernommen hat.

Nja, vielleicht knallte es früher wirklich mal in einer MS-XML-DOM-Implementation?


Alle Zeitangaben in WEZ +1. Es ist jetzt 14:33 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz