How to parse a fragment and insert it in an existing document ?
What I'm trying to achieve is to parse fragments of HTML and insert them in a given document.
For example, I'm trying to parse from string and insert this:
<div>
<span>blablabla</span>
</div>
in a document parsed from this :
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
body > div {
color: blue;
}
</style>
</head>
<body>
<div>
<div>Insert right after:</div>
</div>
</body>
</html>
How to parse a fragment and insert it in an existing document ?
What I'm trying to achieve is to parse fragments of HTML and insert them in a given document.
For example, I'm trying to parse from string and insert this:
in a document parsed from this :