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

Free Support Forum - aspose.com

Replacing place holders with documents

Hi,

I’m currently attempting to insert a document at a place holder. And this is can be capitlized recursively. Ultimately, the stack trace will revel nested replace() functionality occurring using multiple ReplaceEvaluator objects.

Is it typically a bad idea to nest replace operations? Because I’m having a significant number of problems inserting multiple documents.

Program Flow:

  1. Parse Doc via ReplaceEvalutor
  2. Finds [insertDoc(“A”)]
  3. Loads doc
  4. Parse Newly Loaded Doc “A”
  5. Insert Doc A into Current Doc
  6. Parser from step 1 – finds next insertDoc
  7. From this point things become out of order & if the same doc is inserted twice may appear next to each other

Any advice would definitely be helpful. Could it be a problem that I store references to nodes in objects and upon manipulation of the document those, reference can be invalid?

Thanks,

Jamel

for instance during parse.

i try acquire the appropriate node again and it finds the wrong node:

getting node: [p:@DocCol(minsert.docx:$Project.POAItems)]
*----Matchnode
PREV :
MASTER :com.aspose.words.Run@487471:Complete_Project [SP8C]
NEXT :
*-------------

Definitely confused as to why it would find something else other than the RegExpression.

Hi Jamel,

Thanks for your request. Could you please attach your source documents and code here for testing? I will check the issue and provide you more information.

Best regards.