I have some input tags that are placeholders that I am replacing with some HTML. I am using below code to create html node below is the code snippet. But it is giving error as "Multiple node elements can't be created" when there are no multiple nodes.
string tempString = "<p style="margin-left:0px;margin-right:0px;text-indent:0px;text-align:justify;">(c)<span style='display: inline-block; width: 30px; min-width: 30px;'> </span><span class='noCount4'> </span>paragraph <span class="Ellh_">(a)<span class='noCount-44'> </span> of Clause <span class='noCount-48'> </span><span class="Ellj_">25.3<span class='noCount-44'> </span> (<span class='noCount-49'></span> </span><i>Other obligations</i>) as a result of an <span class="El2d_">Obligor </span>failing to comply with its obligations under Clause <span class="Ellm_">24.22<span class='noCount-44'> </span> (<span class='noCount-50'></span> </span><i><span class="El2e_">Financial Indebtedness</i></span>);<span class='noCount-1'> </span></span></p>"
HtmlNode tempNode = HtmlNode.CreateNode(tempString);
But HtmlNode.CreateNode(tempString)
is giving error "Multiple node elements can't be created".
can any one suggest me what is going wrong here.
"Multiple node elements can't be created" is correct however this is can be miss-leading. HtmlNode.CreateNode() only supports single node HTML, that is can only have one external container node.
Change this...
<p>
blah blah...
</p>
<span>
More stuff...
</span>
Into this...
<div>
<p>
blah blah...
</p>
<span>
More stuff...
</span>
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With