GetAttrValue & NODE without attributes lazarus / 49-FPSpreadsheet ---------------------------------------------------------------------- vk_barnaul · 2015-12-17 03:29 unit fpsxmlcommon ... function GetAttrValue(ANode : TDOMNode; AAttrName : string) : string; this function crash if ANode.Attributes = Nil solution if not ANode.HasAttributes then     exit; ---------------------------------------------------------------------- wp · 2015-12-17 11:13 Thanks for reporting. Fixed in r4403. ---------------------------------------------------------------------- vk_barnaul · 2015-12-17 14:41 glad it helped. there is another question: why to find you do not use Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Node: = ANode.Attributes.GetNamedItem (AAttrName);there is a reason for this? ---------------------------------------------------------------------- wp · 2015-12-17 15:03 In which context? What did I use instead of it? ---------------------------------------------------------------------- vk_barnaul · 2015-12-18 00:47 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unit fpsxmlcommon;...function GetAttrValue(ANode : TDOMNode; AAttrName : string) : string;var  i: LongWord;  Found: Boolean;begin  Result := '';  if (ANode = nil) or (ANode.Attributes = nil) then    exit;   Found := false;  i := 0;  while not Found and (i < ANode.Attributes.Length) do begin    if ANode.Attributes.Item[i].NodeName = AAttrName then begin      Found := true;      Result := ANode.Attributes.Item[i].NodeValue;    end;    inc(i);  end;end; may be use Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function GetAttrValue(ANode : TDOMNode; AAttrName : string) : string;begin  Result := '';  if (ANode = nil) or (ANode.Attributes = nil) then    exit;  ANode: = ANode.Attributes.GetNamedItem (AAttrName);  if ANode<>Nil then      Result := ANode.NodeValue;end;