I'm trying to get the plain text from a word document. Specifically, the xpath is giving me trouble. How do you select the tags? Here's the code I have.
public static string TextDump(Package package)
{
StringBuilder builder = new StringBuilder();
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(package.GetPart(new Uri("/word/document.xml", UriKind.Relative)).GetStream());
foreach (XmlNode node in xmlDoc.SelectNodes("/descendant::w:t"))
{
builder.AppendLine(node.InnerText);
}
return builder.ToString();
}