How to customize
We use the Open XML SDK for Office to generate your project documentation by populating content in template DOCX files with data from XML.
All the necessary data from your project is gathered into an XML that has the following structure:
<Project>
<Name/>
<Description/>
<Repository/>
<Branch/>
<PackageConfigurationName/>
<PackageConfigurationVersion/>
<Properties/>
</Project>
<SourceSystems/>
<ModelObjectType Name="">
<ModelObject>
<Id/>
<Name/>
<Attributes/>
<BkCount/>
<DfCount/>
<RelTo/>
<RelFrom/>
<ToCount/>
<DataLineageImage/>
<RelationsImage/>
<DataQualityChecks/>
<Term>
<Name/>
<DataType/>
<Length/>
<Prec/>
<Scale/>
<Nullable/>
<BK/>
<FK/>
<ID/>
<DT/>
<DataQualityChecks/>
</Term>
<Properties />
</ModelObject>
</ModelObjectType>
SourceSystems have elements Name, Type, ObjectCount and SourceObjects, where a SourceObject has Name, TermCount and ObjectCount.
BkCount = count of business keys,
DfCount = count of dataflows,
RelTo = count of relationships this model object contains,
RelFrom = count of relationships that point to this model object,
ToCount = count of target objects,
DataLineageImage = small image (PNG) of up to 2 model objects each side of the current model object's data lineage,
RelationsImage = small image (PNG) of up to 2 model objects each side of the current model object's relationships.
DataQualityChecks have Name, IsActive, ExecutionBehaviour, Logging and ContinueOnFailure.
Properties have elements Name and Value.
If you inspect the default document template you will find content controls like this.
<Content Select="./Project/Description" Optional="true"/>
This specifies an XML Path to the element Description in element Project and has as result the value of the project's description being written to the output.
Optional=true is needed when the element could be missing in the XML.
For collections, there are 2 content controls that can be used:
<Table Select="xml path to an element"_/>
and
<Repeat Select="xml path to an element" />
<EndRepeat/>
"Table Select" must be followed by a table, where attributes or sub-elements of the selected element can be referenced directly (relative to the selected element). Example:
<Table Select="./Project/Properties/Property"/>
Name Value
./Name ./Value
"Repeat Select" can contain other content controls and must be closed with "EndRepeat". Example:
<Repeat Select="./ModelObjectType" />
<Content Select="@Name" /> model objects
<Repeat Select="./ModelObject" />
<Content Select="./Name" />
<EndRepeat/>
<EndRepeat/>
"Conditional Select" is a "Content Select" with a condition.
For example, the following snippet displays the table with properties only if there is at least one property in the collection:
<Conditional Select="count(./Property) > 0" Match="True" />
Properties
<Table Select="./Property"/>
Name Value
./Name ./Value
<EndConditional />
"ImageContent Select" can display the data lineage or the relationships of a model object:
<ImageContent Select="./DataLineageImage" />
or
<Conditional Select="./RelTo > 0 or ./RelFrom > 0" Match="True" />
Relations
<ImageContent Select="./RelationsImage" />
<EndConditional />