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

Free Support Forum - aspose.com

Document with a section break

When I create a document with a section break inside a repeating section content control, and I open the document with Aspose.Words, the content control is not visible in the Aspose.Words object model:

var wordDocument = new Document(pathTemplate);
IEnumerable repeatingSectionControls =
wordDocument.GetChildNodes(NodeType.StructuredDocumentTag, true)
.Where(sdt => ((Markup.StructuredDocumentTag)sdt).SdtType == Markup.SdtType.RepeatingSection);
Assert.AreEqual(1, repeatingSectionControls.Count(), “Repeating section content control not found”);

When we use DocumentFormat.OpenXml, we are able to access this repeating section content control.
With Aspose we aren’t.

Because of other reasons, we can’t use DocumentFormat.OpenXml for our product.
Therefore, we would insist on Aspose supporting this feature.

We saw that the same issue has been raised in the past on your forum, for instance:
Getting SDT child element that contains section break not working

Since then, has your product team been able to solve this issue?
Or will it be solved in the near future?

Thanks in advance.

@itlv

Could you please attach your input Word document here for testing? We will investigate the issue on our side and provide you more information.

Hi @tahir.manzoor

Here is the requested Word document

RepeatingDataMetSectionBreak.zip (15.8 KB)

@itlv

Your document contains section break inside structured document tag. As per current Aspose.Words document model, only sections can be inserted into Document node. We have linked this forum thread to the issue WORDSNET-13519. We will inform you via this forum thread once there is any news available on it.

@itlv

As per Aspose.Words’ document model, only sections can be inserted into Document node. As per current Aspose.Words document model, only sections can be inserted into Document node. We have added read only properties for content control that contains the section break. You can find the detail of these properties from here:

Please use following code example to get the title of content controls.

var doc = new Document(MyDir + "my_sample.docx");
foreach (StructuredDocumentTagRangeStart tag in doc.GetChildNodes(NodeType.StructuredDocumentTagRangeStart, true))
    Console.WriteLine(tag.Title);

foreach (StructuredDocumentTag tag in doc.GetChildNodes(NodeType.StructuredDocumentTag, true))
    Console.WriteLine(tag.Title);

The issues you have found earlier (filed as WORDSNET-13519) have been fixed in this Aspose.Words for .NET 20.7 update and this Aspose.Words for Java 20.7 update.