Free Support Forum - aspose.com

Unique Protected Identifier for Document Sections

Hi, I'd be grateful if someone can answer the following

I want to create a very structured document, containing sections, subsections, etc... They may not necessarily use Word 'style' headings, and if they do those headings may be subject to change anyway. What I really want is to be able to ientify each of these sections programatically, by using some sort of unique protected & hidden identifier, or tag. Ideally it will be similar to a range in that it will have a start & end point. Once the document is complete, the application will have a complete structured, XML-like tree-view of the document.

The document would then be sent to a 3rd party in protected track changes mode. They may then make all sorts of changes, and send the document back. At this point, the application should be able to scan the modified document, and, based on the original reference node 'map', determine which of the original sections have changed.

Would Aspose support this? I saw some interesting concepts in the documentation which may do what I'm looking for but I'm not sure, eg: SDT (Structured Document Tags) or CustomXMLMarkup?

Thanks for your help.

Hi Nassim,


Thanks for your inquiry. For the first part of your request, I think, you should just enclose different portions of your Word document inside Bookmarks. Bookmarks in Aspose.Words are represented by BookmarkStart and BookmarkEnd nodes. If you encapsulate your contents within Bookmarks then BookmarkStart node will help in identifying from where a portion of Document starts. Similarly, BookmarkEnd will be used to mark the end of section etc.

Secondly, If you enable “Track revisions” option in your document before sending to client and then when he changes something in the document, then you can use HasRevisions property to determine if something was changed. Moreover, Using Aspose.Words you can find deleted and inserted content. Paragraph and Run nodes have IsDeleteRevision and IsInsertRevision properties that allow determining whether these nodes were inserted or deleted:
http://www.aspose.com/docs/display/wordsnet/Inline+Members

Moreover, I would suggest you please read the following API pages that outline both SDT and CustomXMLMarkup:
http://www.aspose.com/docs/display/wordsnet/StructuredDocumentTag+Class
http://www.aspose.com/docs/display/wordsnet/CustomXmlMarkup+Class

Best Regards,