简体   繁体   中英

How to convert HTML string to XHTML in C#?

I'm currently pulling back HTML results using the DevOps API and then using the text to build up a word doc. The Word Doc software I'm using requires XHTML format and I'm getting HTML from the API result. Does anyone have any experience converting one to the other?

I was looking at working through each of the HTML nodes in the html string using html-agility-pack, getting the node.InnerText for each and then using this to build up my word doc, but just wanted to see if anyone had a better approach? Thanks.

I'm currently pulling back HTML results using the DevOps API and then using the text to build up a word doc. The Word Doc software I'm using requires XHTML format and I'm getting HTML from the API result. Does anyone have any experience converting one to the other?

I was looking at working through each of the HTML nodes in the html string using html-agility-pack, getting the node.InnerText for each and then using this to build up my word doc, but just wanted to see if anyone had a better approach? Thanks.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM