I use the htmlcxx library to read an HTML file and create the same HTML file with additional content.
I can read the file without problems, but just emitting the original HTML file incorrectly includes end tags. That is, when I simply repeat and display the entire DOM, no closing tags are emitted.
I know that there is an interface closingText()for node (see Node.h), but I cannot find a way to use it that allows me to do what I need.
This is how I reset the DOM:
it = dom.begin();
end = dom.end();
for (; it != end; ++it)
{
cout << it->text();
}
From the above:
<div>
<li>
<div>
(blank)
(blank)
(blank)
<div>
(blank)
for the following html:
<div>
<li>
<div>
</div>
</li>
</div>
<div>
</div>
Anything I can do except change the code?
source
share