A Guide to Office Open XML

Om Rastogi
5 min readAug 7, 2021

Have you ever wondered, how presentations and documentations are rendered. The GUI is written in xml format defined by ISO/IEC 29500–1:2008. Here is a basic guide about the format and basic vocabulary.

<cSld> (Common Slide Data)

This element specifies a container for the type of slide information that is relevant to all of the slide types. All slides share a common set of properties that is independent of the slide type; the description of these properties for any particular slide is stored within the slide’s <cSld> container. Slide data specific to the slide type indicated by the parent element is stored elsewhere

<spTree> (Shape Tree)

This element specifies all shapes within a slide. Contained within here are all the shapes, either grouped or not, that can be referenced on a given slide. As most objects within a slide are shapes, this represents the majority of content within a slide. Text and effects are attached to shapes that are contained within the <spTree> element.

<grpSp> (Group Shape)

This element specifies a group shape that represents many shapes grouped together. This shape is to be treated just as if it were a regular shape but instead of being described by a single geometry it is made up of all the shape geometries encompassed within it. Within a group shape each of the shapes that make up the group are specified just as they normally would. The idea behind grouping elements however is that a single transform can apply to many shapes at the same time.

<grpSpPr> (Group Shape Properties)

This element specifies the properties that are to be common across all of the shapes within the corresponding group. If there are any conflicting properties within the group shape properties and the individual shape properties then the individual shape properties should take precedence.

<sp> (Shape)

This element specifies the existence of a single shape. A shape can either be a preset or a custom geometry, defined using the <DrawingML> framework. In addition to a geometry each shape can have both visual and non-visual properties attached. Text and corresponding styling information can also be attached to a shape. This shape is specified along with all other shapes within either the shape tree or group shape elements.

[Note: Shapes are the preferred mechanism for specifying text on a slide.]

<pic> (Picture)

This element specifies the existence of a picture object within the document.

<cxnSp> (Connection Shape)

This element specifies a connection shape that is used to connect two <sp> elements. Once a connection is specified using a <cxnSp>, it is left to the generating application to determine the exact path the connector will take. That is the connector routing algorithm is left up to the generating application as the desired path might be different depending on the specific needs of the application.

<graphicFrame> (Graphic Frame)

This element specifies the existence of a graphics frame. This frame contains a graphic that was generated by an external source and needs a container in which to be displayed on the slide surface.

<graphic> (Graphic Object)

This element specifies the existence of a single graphic object. Document authors should refer to this element when they wish to persist a graphical object of some kind. The specification for this graphical object will be provided entirely by the document author and referenced within the <graphicData> child element.

<graphicData> (Graphic Object Data)

This element specifies the reference to a graphic object within the document. This graphic object is provided entirely by the document authors who choose to persist this data within the document.

Attributes: <uri> Specifies the URI, or uniform resource identifier that represents the data stored under this tag. The URI is used to identify the correct ‘server’ that can process the contents of this tag. The possible values for this attribute are defined by the XML Schema token datatype.

<extLst> (Extension List with Modification Flag)

This element specifies the extension list with modification ability within which all future extensions of type <ext> will be defined. The extension list along with corresponding future extensions is used to extend the storage capabilities of the <PresentationML> framework. This allows for various new types of data to be stored natively within the framework.

<xfrm> (2D Transform for Individual Objects)

This element represents 2-D transforms for ordinary shapes.

Child Elements:

<ext> (Extents)

<off> (Offset)

Attributes:

<flipH> (Horizontal Flip)

Horizontal flip. When true, this attribute defines that the group will be flipped horizontally about the center of its bounding box.

<flipV> (Vertical Flip)

Vertical flip. When true, this attribute defines that the group will be flipped vertically about the center of its bounding box.example: — The following illustrates the effect of a vertical flip.

<rot> (Rotation)

Rotation. Specifies the clockwise rotation of a group in 1/64000 of a degree. The possible values for this attribute are defined by the ST_Angle simple type

<ST_Angle> (Angle): This simple type represents an angle in 60,000ths of a degree. Positive angles are clockwise (i.e., towards the positive y axis); negative angles are counter-clockwise (i.e., towards the negative y axis).
This simple type’s contents are a restriction of the XML Schema int datatype. The following XML Schema fragment defines the contents of this simple type:

<xfrm> (2D Transform for Grouped Objects)

This element is nearly identical to the representation of 2-D transforms for ordinary shapes. The only addition is a member to represent the Child offset and the Child extents.

<chExt> (Child Extents)

This element specifies the size dimensions of the child extents rectangle and is used for calculations of grouping, scaling, and rotation behavior of shapes placed within a group.

<chOff> (Child Offset)

This element specifies the location of the child extents rectangle and is used for calculations of grouping, scaling, and rotation behavior of shapes placed within a group.

<ext> (Extents)

This element specifies the size of the bounding box enclosing the referenced object.

<off> (Offset)

This element specifies the location of the bounding box of an object. Effects on an object are not included in this bounding box.

--

--

Om Rastogi

I believe in an altruistic world, where creativity and imagination replace repetitive work