We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How can I extract the segment content just like the XMLDocument Reader?

The clients use the word document to store the structured infomation, we must abstract and import these information into database. Is there any good method to abstract the node content?

the attachment is the example.

thanks.

Hi Andy,

Thanks for your inquiry.

The code from this article here can help you to extract the content from the document.

You can use it to gather the nodes in each block like this below:

Paragraph startPara;

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

foreach (Paragraph para in doc.GetChildNodes(NodeType.Paragraph, true))

{

if (para.Range.Text.Contains("Content"))

startPara = para;

else if (para.Range.Text.Contains("Difficult"))

{

ArrayList nodes = ExtractContent(startPara, para, true);

Document subDoc = GenerateDocument(doc, nodes);

// Save the document to database.

}

}

For information on saving a document to a database, please see the article here.

If have any questions, please feel free to ask.

Thanks,