fast-html-parser
fast-html-parser copied to clipboard
GetElementById problem
Hi,
This code returns and an empty HtmlTagEnd as output instead of an empty string and </div> for HtmlTagEnd.
procedure doHTML;
const
RawHTML =
'<!DOCTYPE html>' + #13#10 +
'<html>' + #13#10 +
'<head>' + #13#10 +
'<meta http-equiv="content-type" content="text/html;' + #13#10 +
'charset=windows-1252">' + #13#10 +
'<title></title>' + #13#10 +
'</head>' + #13#10 +
'<body>' + #13#10 +
'<div align="center"> <font color="#006600"><b>Strong Data Digital' + #13#10 +
'Template</b></font> <br>' + #13#10 +
'<font color="#000099">XML Base64 Encoded Document [xmlDoc]</font>' + #13#10 +
'</div>' + #13#10 +
'<div id="xmlDoc" style="display: none;">' + #13#10 +
'</div>' + #13#10 +
'</body>' + #13#10 +
'</html>';
var
Parser : THTMLParser;
HtmlTag ,
HtmlTagEnd : string;
begin
Parser := THTMLParser.Create(RawHTML);
Memo1.Lines.Text := Parser.GetElementById('xmlDoc',HtmlTag,HtmlTagEnd);
FreeAndNil(Parser);
end;
Best regards.