My goal is to use a WCF Service to accept some parameters, generate and then return a HTML string that a user can use to embed on certain webpages of their choice.
Is XDocument appropriate for generating a string of HTML?
I do not really need a full HTML document, just a simple snippet that has some image elements, a p-tag element, and a table element.
It's suitable for generating XHTML, which is valid XML. It wouldn't be suitable for parsing HTML, which doesn't have to be a valid XML document.
There may be more HTML-specific APIs available, but for just a simple snippet of XHTML, using XDocument should be fine.
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