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

Free Support Forum - aspose.com

Support for INCLUDETEXT and XPATH expressions

Does Aspose Words support the use of INCLUDETEXT fields referencing and XML file and using XPATH expressions?

This is an example of declaration of the field we are trying to use:

<span style=“font-size:11.0pt;line-height:115%;
mso-bidi-font-family:“Times New Roman”;mso-bidi-theme-font:minor-bidi;
mso-ansi-language:ES;mso-fareast-language:EN-US;mso-bidi-language:AR-SA”>{ INCLUDETEXT “http://server/data.xml”

The objective with this field is to insert the text of the element referenced by the XPATH but when we try this with Aspose Words it inserts the text of the whole XML document. It’s like if it doesn’t understand the “\x” option for using XPATH expressions.

Hi Alberto,

Thanks for your inquiry. Please attach the following resources here for testing

  • Template Word document containing INCLUDETEXT field with XPATH expressions
  • Sample XML file
  • Aspose.Words generated output DOCX which shows the undesired behavior
  • Expected DOCX document which shows the correct output. You can create expected document using Microsoft Word.
  • Source code you’re using on your end

We will then investigate the issue on our end and provide you more information.

Best regards,
Find attached in the zip file all the documents requested:
  • Template: demo.docx
  • Sample XML: data.xml
  • Aspose result: result - aspose.docx
  • Word result: result - good.docx
The source code is:

Document doc = new Document(@"c:\temp\demo.docx");


doc.Save(@"c:\temp\result - aspose.docx");


Hi Alberto,

Thanks for your inquiry.

While using the latest version of Aspose.Words i.e. 15.7.0, we managed to reproduce this issue on our end. We have logged this issue in our bug tracking system. The ID of this issue is WORDSNET-12298. Your thread has also been linked to this issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

Best regards,

The issues you have found earlier (filed as WORDSNET-12298) have been fixed in this .NET update and this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.