Table of Contents

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/>
    <DataQualityChecks/>
    <Term>
      <Name/>
      <DataType/>
      <Length/>
      <Prec/>
      <Scale/>
      <Nullable/>
      <BK/>
      <FK/>
      <ID/>
      <DT/>
      <DataQualityChecks/>
    </Term>
    <Properties />
  </ModelObject>
</ModelObjectType>

Properties have elements Name and Value. SourceSystems have elements Name, Type, ObjectCount and SourceObjects, where a SourceObject has Name, TermCount and ObjectCount DataQualityChecks have Name, IsActive, ExecutionBehaviour, Logging and ContinueOnFailure

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 of a model object:

<ImageContent Select="./DataLineageImage" />