Reputation: 24218
Hi and thanks for looking!
I am working on a developer tool for our dev team that parses content from MS Word into a Windows form with text boxes. We do some processing on the text, then submit the form to a database.
Some of the textboxes in the form contain Word XML which we need to clean up and convert to our own XML to later use with XSLT.
When the form populates, I would like to take the Word XML and use Linq to search for certain tags (example: <w:t>SOME TEXT</w:t>
) and convert it to our own XML (<Text>SOME TEXT</Text>
) before it gets to the textbox.
How do I use Linq-to-Xml on the contents retrieved from a string in the pre-processing stage? I know how to instantiate an XDocument, but this is just a string so I am stumped. Probably missing something simple.
Thanks!
Upvotes: 0
Views: 113
Reputation: 217361
You can use the XDocument.Parse Method to create an XDocument from a string.
Upvotes: 3