MSAS: Cube definition as a MindMap document

Technical Value

Sometimes you need to document your cube structure or pass it to another person for the review or comments. It is not always convenient to use a native AS definition in the form of Visual Studio Project or creation script. Other people can not have Visual Studio installed or may want to add their comments into it.

Fortunately the AS definitions are XML based so we can use XSL transformations to generate documents that can be digested by your favorite XML-speaking tools.

Here we demonstrate the transformation of the AS definition of a multidimensional database (XML/A) into MindMap format (.mm) that can be used for example by FreeMind tool.

The input document containing the AS database can be obtained by building the project in Visual Studio (.asdatabase) of by scripting out the live database in Management Studio (Script Database as->CREATE To->File).

To execute the XSLT you can use XML Notepad , XML tools in Management Studio or even the SSIS XML task or PowerShell for automation.

The simplest XSLT (xmla2mm.xslt) can look like following:

  1. <?xml version="1.0"?>
  2. <xsl:stylesheet version="1.0"
  3. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  4. xmlns:as="http://schemas.microsoft.com/analysisservices/2003/engine" >
  5.   <xsl:output omit-xml-declaration="yes"/>
  7.   <xsl:template match="/">
  8.     <map version="0.9.0">
  9.       <xsl:apply-templates select="//as:Database"/>
  10.     </map>
  11.   </xsl:template>
  13.   <xsl:template match="as:Database |
  14.                       as:Cubes | as:Cube |
  15.                       as:DataSources | as:DataSource |
  16.                       as:DataSourceViews | as:DataSourceView |
  17.                       as:Roles | as:Role |
  18.                       as:Members | as:Member |
  19.                       as:MeasureGroups | as:MeasureGroup |
  20.                       as:Dimensions | as:Dimension |
  21.                       as:Attributes | as:Attribute |
  22.                       as:Hierarchies | as:Hierarchy |
  23.                       as:Levels | as:Level |
  24.                       as:Measures | as:Measure |
  25.                       as:Partitions | as:Partition">
  26.     <node CREATED="1" ID="ID1" MODIFIED="1">
  27.       <xsl:attribute name="TEXT">
  28.         <xsl:if test="as:Name">
  29.           <xsl:value-of select="as:Name"/>
  30.         </xsl:if>
  31.         <xsl:if test="not(as:Name)">
  32.           <xsl:value-of select="name()"/>
  33.         </xsl:if>
  34.       </xsl:attribute>
  35.       <xsl:if test="name()!='Database'">
  36.         <xsl:attribute name="FOLDED">true</xsl:attribute>
  37.       </xsl:if>
  38.       <xsl:apply-templates />
  39.     </node>
  40.   </xsl:template>
  42.   <xsl:template match="*">
  43.   </xsl:template>
  45. </xsl:stylesheet>

Here is what the transformation does:

  • produces a .mm tree structure which exactly mimics the object structure of the AS database for the certain subset of node types (see enumeration under …match=”…”)
  • the Name-elements of AS objects are taken as MM node names unless Name is not found (in this case the object type is used, for example “Dimensions”, see xsl:attribute name="TEXT"…)
  • only the root node is unfolded (see “xsl:if test="name()!='Database'"”) 


The beginning of the result document looks like following (Adventure Works):

  1. <map version="0.9.0" xmlns:as="http://schemas.microsoft.com/analysisservices/2003/engine" >
  2.   <node CREATED="1" ID="ID1" MODIFIED="1" TEXT="Adventure Works DW 2008R2">
  3.     <node CREATED="1" ID="ID1" MODIFIED="1" TEXT="Dimensions" FOLDED="true">
  4.       <node CREATED="1" ID="ID1" MODIFIED="1" TEXT="Promotion" FOLDED="true">
  5.         <node CREATED="1" ID="ID1" MODIFIED="1" TEXT="Attributes" FOLDED="true">
  6.           <node CREATED="1" ID="ID1" MODIFIED="1" TEXT="Promotion" FOLDED="true" />
  7.           <node CREATED="1" ID="ID1" MODIFIED="1" TEXT="Discount Percent" FOLDED="true" />
  8.           <node CREATED="1" ID="ID1" MODIFIED="1" TEXT="Max Quantity" FOLDED="true" />
  9.           <node CREATED="1" ID="ID1" MODIFIED="1" TEXT="Promotion Type" FOLDED="true" />
  10.           <node CREATED="1" ID="ID1" MODIFIED="1" TEXT="Min Quantity" FOLDED="true" />
  11.           <node CREATED="1" ID="ID1" MODIFIED="1" TEXT="Promotion Category" FOLDED="true" />
  12.           <node CREATED="1" ID="ID1" MODIFIED="1" TEXT="End Date" FOLDED="true" />
  13.           <node CREATED="1" ID="ID1" MODIFIED="1" TEXT="Start Date" FOLDED="true" />

Here is how it looks in FreeMind:


We intentionally put only the minimal logic into transformation so you can spice it up with your own features like:

  • custom logic for different AS object by using more specific elements of xsl:template
  • icons related to AS object types (example: <icon BUILTIN="gohome"/>)
  • node colors or font types
  • more AS object types (add to enumeration or place as another xsl:template)
  • AS features as MM attributes (additional text info)

To see how the MM document should look like just browse the file having the features you are interested in or have a look at the description for example here .

The basic info how the XSL transformations work can be found here .

See also other topics of using XSL transformation on AS definitions:

  • XPath and XSLT for the metadata analysis of Analysis Services objects
  • MSAS: XSLT for cube management
  • MSAS: Extensions for XSLT cube management
  • XSLT for Analysis Services : replay the partition definition

Neuen Kommentar schreiben

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.


  • Keine HTML-Tags erlaubt.
  • HTML - Zeilenumbrüche und Absätze werden automatisch erzeugt.
  • Web page addresses and email addresses turn into links automatically.
Teilen auf

Newsletter Anmeldung

Abonnieren Sie unseren Newsletter!
Lassen Sie sich regelmäßig über alle Neuigkeiten rundum ORAYLIS und die BI- & Big-Data-Branche informieren.

Jetzt anmelden