Free Support Forum -

How to remove run nodes that contain field content

I am using Aspose.Words for Java version 10.1 and I'm not sure how to remove run nodes that contain field info. Basically I have Java classes that load MS Word docx file into Aspose DOM then I walk the the document and write out the nodes to an xml writer. so my conversion converts docx files to an xml file. Apoun reviewing the content I am seeing runs that contain field information.

In the example below the 5th ,8th and 9th runs contain contain field information, Is there away to indentify these runs and hide then or remove them when I walking the DOM.

b. During a three-month period, the defendant, a former college and professional football player, a member of the state legislature, and an a
coholic, wrote seventy-six checks on a closed account to pay for $8,000 worth of goods and services. He pled guilty to one count of theft over $250. By the time of the sentencing hearing, he had paid back the money owed for the bad checks. See
TA \l "
v. Staten,

390 N.W.2d 914 (Minn.App.1986)
" \s "WSFTA_01ea0b860aec403ab4aa90d003aa157a" \c 3
v. Staten, 390 N.W.2d 914 (Minn.App.1986)

Hi Linda,

Thanks for your inquiry.

You can easily achieve this by using implementing the DocumentVisitor pattern. Please see the example here which shows exactly how to export the text of each node while skipping the text of fields.