In the further adventures of OOXML we have been looking at different approaches to tagging content in a Word template to be programmatically replaced. 

 

Initially we looked at simple in-line text as a user defined tagging system.  The problem is that this is very error prone.  The user has to enter the tag exactly the same every time.  On top of that if the user backspaces while typing the tag or spell check flags the tag then the tag will be split into multiple tags.  This is less than desirable.

 

Content Controls were the next option we explored.  This gives you specific object types to search for, but you still have the user filling in the Tag property for each control.  The user error factor is still not eliminated.  The other problem is that each control has a possible different type.  This is a better option, but still not optimal.

 

Ultimately we settled on Custom XML schema.  We found that they can equally wrap all of the different types of content within a document.  The user error factor is also removed because you highlight your content and then select the tag from a list.  In the end you have a reliable template format and have simplified your code to locate tags.

 

More to come.

Technorati Tags: ,,