Program.zip (1.5 KB)
Hello,
We have recently started an upgrade on our code base from version 21.1.0 to 22.12.0 and have noticed that the GetChilNodes method returns different count of items. Additionally, the Document object within the chilNode hierarchy is different from one version to the next.
I have created a test application currently running on 22.12.0, please see attached .cs file. Note, please run the same file on version 21.1.0 to replicate the behavior.
The gist of the program is the following:
- Create
contentDoc1
a Document with a table containing nested RepeatingSection SDTs. This document is treated as a document with source content. - Create
assembledDoc
a Document containing 2 RichText SDTs within the body of the Document. - Insert the
contentDoc1
into the RictText SDT within theassembledDoc
Document.
Here is the behavior we are seeing when making a call to get the nodes of type structuredDocumentTag
like so:
var nodes = assembledTemplate.GetChildNodes(Aspose.Words.NodeType.StructuredDocumentTag, true);
On version 21.1.0
- Yields a count of 2 nodes.
On version 22.12.0
- Yields a count of 3 nodes.
Additionally, inspecting the Document object the hierarchy of the final assembled document is also different.
On version 21.1.0
- Aspose.Words.Document
- Aspose.Words.Section
- Aspose.Words.Body
- Aspose.Words.Tables.Table
- Aspose.Words.Markup.StructuredDocumentTag (NodeType: āRepeatingSectionā, Title: āSection2ā)
- Aspose.Words.Tables.Row
- Aspose.Words.Markup.StructuredDocumentTag (NodeType: āRepeatingSectionā, Title: āSection2ā)
- Aspose.Words.Tables.Table
- Aspose.Words.Body
- Aspose.Words.Section
On version 22.12.0
- Aspose.Words.Document
- Aspose.Words.Section
- Aspose.Words.Body
- Aspose.Words.Tables.Table
- Aspose.Words.Markup.StructuredDocumentTag (NodeType: āRepeatingSectionā, Title: āSection1ā)
- Aspose.Words.Markup.StructuredDocumentTag (NodeType: āRepeatingSectionā, Title: āSection2ā)
- Aspose.Words.Tables.Row
- Aspose.Words.Markup.StructuredDocumentTag (NodeType: āRepeatingSectionā, Title: āSection2ā)
- Aspose.Words.Markup.StructuredDocumentTag (NodeType: āRepeatingSectionā, Title: āSection1ā)
- Aspose.Words.Tables.Table
- Aspose.Words.Body
- Aspose.Words.Section
Please help me understand what is happening here and why the GetChildNodes call yields different results when upgrading versions.
Thanks!