%% Test If HTML Tree Is Root Node
% To test if an HTML tree object represents a root node, test that the Parent property is missing.
% Read HTML code from the URL https://www.mathworks.com/help/textanalytics using webread.

url = "https://www.mathworks.com/help/textanalytics";
code = webread(url);

% Parse the HTML code using htmlTree.

tree = htmlTree(code);

% Test if the parent of tree references an HTML tree.

tf = ismissing(tree.Parent)

% Since tree represents the root node of the HTML tree, the value of tree.Parent is missing and the ismissing function returns 1 (true).
% Copyright 2018 The MathWorks, Inc.