[XML] TDOMNode.NodeValue is empty lazarus / 21-General ---------------------------------------------------------------------- CC · 2022-03-28 08:55 Hi, this is quite strange: VER: FPC 3.2 up to date fixes branch document: xml version="1.0" encoding="UTF-8" The first few levels are only categories. Here is where reading the actual data begins: After    iNode:= CategoryNode .FirstChild is  executed     1. iNode.NodeName has the right value;     2. but iNode.NodeValue is always empty even though it always has a value in the file. Debugging uncovered  that this function is called to get the value: 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 TDOMNode.GetNodeValue: DOMString;begin  Result := '';end;   Which explains why NodeValue is always empty, but I would expect some overridden function to be called instead with access to the actual value. iNode.NodeType = ELEMENT_NODE. But after checking the DOM unit's source neither TDOMElement nor it's ancestors have any overridden GetNodeValue.  The only such overridden function is 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 TDOMCharacterData.GetNodeValue: DOMString;begin  Result := FNodeValue;end;  So it seems iNode.NodeType should be a TEXT_NODE instead of ELEMENT_NODE. Why is it not? This should be so simple. Where am I going wrong? ---------------------------------------------------------------------- CC · 2022-03-28 10:13 The answer to my question is so trivial: iNode.TextContent should be used instead of iNode.NodeValue