SlideShare a Scribd company logo
Components of WordprocessingML
• Main Document
• Paragraphs & Rich Formatting
– Runs
– Run Content
• Tables
• Custom Markup
• Sections
• Styles
– Paragraph
– Character
– Numbering
– Table
– Document Defaults
• Fonts
• Numbering
• Headers/Footers
• Footnotes/Endnotes
• Glossary Document
• Annotations
– Comments
– Revisions
– Bookmarks
• Mail Merge
• Document Settings
– Web Settings
– Compatibility Settings
• Fields & Hyperlinks
• Odds & Ends (Textboxes, Subdocuments, Extensibility)
Ecma/TC45/2006/059 (Rev.)
WordprocessingML - Styles
Style Information
• A style defines a specific set of formatting
properties
– For example, the Normal style in Word 2003 is
defined as:
• Font = Times New Roman
• Font Size = 12 point
• Font Language = Language of Word (English (US) for
me)
• Justification = Left
• Line Spacing = Single
• Widow/Orphan control
Styles Storage
• Within a WordprocessingML package, styles
are stored in a unique part
– Target of an implicit relationship from the
document part
– Relationship type:
http://schemas.openxmlformats.org/wordprocessingml/2006/st
yles
– Content type:
vnd-openxmlformats.officedocument.wordprocessingml-
styles+xml
Styles Storage
• Within the styles part, there are two primary
components:
– Style definitions
– Latent style information
Style Definitions
• A style is defined using the style element
• The style definition contains three pieces of
information
– Common style properties
– Style 'type'
– Type-specific properties
Common Style Properties
• All styles share a set of common properties:
– Style name
– Additional aliases
– Style ID
• This is what is used to reference this style from
document content
– Automatically redefine based on direct formatting
– Hidden
Common Style Properties
• Common properties (cont'd):
– Lock (prevent changes to style)
– Priority (for user interface sorting)
– Unhide when used (for user interface)
– Semi-hidden
– Revision ID (used to compare two instances of a
style)
Common Style Properties
• ..and the most interesting two properties:
– Parent style on which this style is based (which
we'll discuss more later)
– Is this style the default for its type? (i.e. is this the
style that is applied when no style of this type is
referenced by the content)
Style Example
Common properties:
Style name
Quick Format
Revision ID
Style Types
• WordprocessingML supports the creation of
six different types of styles:
– Paragraph styles
– Character styles
– Linked styles (paragraph + character)
– Table styles
– List styles
– Default paragraph + character properties
Paragraph Styles
• Paragraph styles apply to the contents of an
entire paragraph as well as the paragraph
mark
– This means they can affect the paragraph
properties as well as the text formatting
– They cannot be applied to sub-paragraph ranges
Paragraph Styles
• A paragraph style has three defining
characteristics:
– It is specified using a type attribute of "paragraph"
on the style element
– It defines the paragraph style for the next
paragraph
– It contains both a set of run properties (rPr) and
paragraph properties (pPr)
Paragraph Styles
• The run properties are the set of properties
applied to each run in the paragraph
Paragraph Styles Example
• Consider a paragraph style "Test Paragraph
Style" which defines:
– Font: Algerian
– Font Size: 20
– Font Color: Red
– Paragraph Spacing: double
– Paragraph Indent: 1" (first line)
Paragraph Styles Example
• In styles part:
Common Properties
Paragraph Properties
Character (Run) Properties
Paragraph Styles Example
• In document part:
Character Styles
• Character styles apply to the contents of one
or more runs which are explicitly given that
character style
– They can be applied to any run within the
document
– Cannot specify paragraph properties
Character Styles
• A character style has two defining
characteristics:
– It is specified using a type attribute of "character"
on the style element
– It contains only a set of run properties (rPr)
• The run properties are the set of properties to
each run who references the character style
Character Styles Example
• Consider a character style which is defined as
follows:
– Font: Courier New
– Font Color: Yellow
– Underline
Character Styles Example
• In styles part:
Common Properties
Character (Run) Properties
Character Styles Example
• In main document part:
Linked Styles
• Linked styles are a paired combination of both
a paragraph and character style
• This allows the style to be used in both
paragraph and character contexts
– When the current selection is a run, the character
style is applied
– When the current selection is a paragraph, the
paragraph style is applied
Linked Styles
• Linked styles in WordprocessingML are
literally two styles: one paragraph, one
character
• They are 'linked' using the link element
• This tells the consumer that it should mask
the fact that these are two different styles at
runtime
Linked Styles
• The two are linked via the other's styleId
Linked Style Example
• Consider a linked style defined as follows:
– Font: Arial (a character property)
– Font Color: green (a character property)
– Double spaced (a paragraph property)
– 1" left indent (a paragraph property)
• In the styles part, we get two style definitions:
Linked Style Example
• A paragraph style:
Wants to link to a character
style with styleID =
"TestLinkedStyleChar"
Linked Style Example
• A character style:
Wants to link to a paragraph
style with styleID =
"TestLinkedStyle"
Linked Style Example
• And each style can be referenced in the main
document part:
Linked Style Example
Numbering Styles
• Numbering styles are styles which define the
structure of a multi-level numbering format
• They are an index into a numbering format
that is stored with the document
• The numbering style syntax is used to give the
numbering style a persistent name, as well as
specify common style properties
Table Styles
• Table styles supply formatting information for
tables
– e.g. borders, shading, etc.
• As well, they provide formatting information
for the text of the table's contents
Table Styles
• A table is associated with a style via the tblStyle element
Associated Table Style
Components of Table Style Used
Table Styles
• Although each of these properties are
optional, their omissions each supply a default
value:
– Omitting tblStyle uses the default table style
– Omitting tblLook specifies that all aspects of the
table style should be included
Table Sections
• Table styles have all of the properties that can
be applied to a table
– Like paragraph styles and paragraph formatting
• However, table styles allow for the definition
of unique formats for different table 'sections'
of the table
Table Sections
Within the main table rows, there are also table formatting
properties for alternating rows and columns
Table Sections
banded row
banded row
even row stripe
even row stripe
Table Section Priorities
1.Top left, top right, bottom left, bottom right
2.First column, last column
3.First row, last row
4.Banded rows, even row banding
5.Banded columns, even column banding
6.Whole table
(application order is bottom to top)
Table Style
Apply parts of table style
with Table Look:
Default Paragraph and Character
Properties
• Whew! The final type of style isn't really a
style as much as a set of properties
• Let's come back to this…
Style Inheritance
• Styles of any given type can inherit from other styles
of that type.
– e.g. The Tristan Test style can inherit from the Heading 1
paragraph style can be specified to inherit properties from
the Normal paragraph style
• This lineage is traced using the basedOn element, which
specifies the styleId of the 'parent'
Style Inheritance
• To build up the resulting style:
– Trace the hierarchy back to its root
– Follow each level down, applying its properties
– When properties conflict, they are overridden (this
includes turning OFF a property set at an earlier level)
• On save, properties that match those
inherited are not explicitly saved for that style
Default Paragraph and Character
Properties
• Now that we've covered style inheritance…
• All styles eventually inherit back to a style
which has no basedOn property
• This means we need to have a default value
for formatting properties
– What would it mean if Font was never explicitly
specified in a style hierarchy?
Default Paragraph and Character
Properties
• These default properties are called the
document defaults and are applied before any
other formatting information
• However, in previous versions of Word these
defaults were coded into the EXE and could
not be changed
• In WordprocessingML, these defaults are
stored in the styles part under the
docDefaults element
Default Paragraph and Character
Properties
default
run
properties
default
paragraph
properties
Style Application
• Multiple style ‘types’ can be applied to the same text
within a file, so properties are applied in a specific
order.
– As with inheritance, the resulting formatting
properties set by one type can be removed or
supplemented by following types.
Style Application
Table Characters Paragraph List Item
Table
Paragraph
Character
Direct Formatting
Numbering
Applicationorder
Document Defaults
Style Application
• First, the document defaults are applied to
text
• Next, the table style properties are applied to
each table in the document
• Next, list item and paragraph properties are
applied to each paragraph formatted with a
list style
• Next, paragraph and run properties are
applied to each paragraph
Style Application
• Next, run properties are applied based on
character styles
• Finally, we apply direct formatting (paragraph
or run properties not from styles)
• It's important to remember that each level
can *not* specify properties and get the
properties from previous levels
Latent Styles
• The other piece of style information stored in
the document
• Stores properties about styles without saving
the actual style in the file
– e.g. for documents where formatting is restricted
to a selection of styles – can this one be used?
• Needed because the document may not have
access to its template
Latent Styles
• Latent style properties:
– Style lockdown (can style be used?)
– UI sorting priority
– Use as top-level format
– Unhide when used
Latent Styles
• For efficiency, the latent style information is
stored as a set of latent style defaults with
exceptions defining properties for those styles
which do not match the defaults
Disclaimer
This presentation is for informational purposes only, and should
not be relied upon as a substitute or replacement for Microsoft
formal file format documentation, which is available at the
following website: https://msdn.microsoft.com/en-
us/library/cc313118(v=office.12).aspx. Any views or opinions
presented in this material are solely those of the author and do
not necessarily represent those of Microsoft. Microsoft
disclaims all liability for mistakes or inaccuracies in this
presentation.

More Related Content

Viewers also liked

Tous les mémes Vincenzo
Tous les mémes VincenzoTous les mémes Vincenzo
Tous les mémes Vincenzo
rcmuziek14
 
Résultats du sondage coworking Vincennes mai 2012
Résultats du sondage coworking Vincennes mai 2012Résultats du sondage coworking Vincennes mai 2012
Résultats du sondage coworking Vincennes mai 2012
Cowork in the city
 
14a report writing
14a  report writing14a  report writing
14a report writing
mbarram
 

Viewers also liked (16)

DrawingML Subject: Transforms
DrawingML Subject: TransformsDrawingML Subject: Transforms
DrawingML Subject: Transforms
 
1 wordprocessing ml subject - main document
1   wordprocessing ml subject - main document1   wordprocessing ml subject - main document
1 wordprocessing ml subject - main document
 
H61 m dgs
H61 m dgsH61 m dgs
H61 m dgs
 
15 wordprocessing ml subject - fields and hyperlinks
15   wordprocessing ml subject - fields and hyperlinks15   wordprocessing ml subject - fields and hyperlinks
15 wordprocessing ml subject - fields and hyperlinks
 
Spreadsheet ml subject external links
Spreadsheet ml subject   external linksSpreadsheet ml subject   external links
Spreadsheet ml subject external links
 
Spreadsheet ml subject xml-mapping
Spreadsheet ml subject   xml-mappingSpreadsheet ml subject   xml-mapping
Spreadsheet ml subject xml-mapping
 
12 wordprocessing ml subject - annotations
12   wordprocessing ml subject - annotations12   wordprocessing ml subject - annotations
12 wordprocessing ml subject - annotations
 
PresentationML Subject: Slides
PresentationML Subject: SlidesPresentationML Subject: Slides
PresentationML Subject: Slides
 
Spreadsheet ml subject pivottable
Spreadsheet ml subject   pivottableSpreadsheet ml subject   pivottable
Spreadsheet ml subject pivottable
 
DrawingML Subject: Text
DrawingML Subject: TextDrawingML Subject: Text
DrawingML Subject: Text
 
DrawingML Subject: Shape Properties & Effects
DrawingML Subject: Shape Properties & EffectsDrawingML Subject: Shape Properties & Effects
DrawingML Subject: Shape Properties & Effects
 
8 wordprocessing ml subject - numbering
8   wordprocessing ml subject - numbering8   wordprocessing ml subject - numbering
8 wordprocessing ml subject - numbering
 
Tous les mémes Vincenzo
Tous les mémes VincenzoTous les mémes Vincenzo
Tous les mémes Vincenzo
 
Résultats du sondage coworking Vincennes mai 2012
Résultats du sondage coworking Vincennes mai 2012Résultats du sondage coworking Vincennes mai 2012
Résultats du sondage coworking Vincennes mai 2012
 
14a report writing
14a  report writing14a  report writing
14a report writing
 
Ten Hiring Mistakes
Ten Hiring MistakesTen Hiring Mistakes
Ten Hiring Mistakes
 

Similar to 6 wordprocessing ml subject - styles

Cs 371-lecture-02
Cs 371-lecture-02Cs 371-lecture-02
Cs 371-lecture-02
Iqra Tariq
 
Introducing Cascading Style Sheets
Introducing Cascading Style SheetsIntroducing Cascading Style Sheets
Introducing Cascading Style Sheets
Bravocash
 

Similar to 6 wordprocessing ml subject - styles (20)

5 wordprocessing ml subject - sections
5   wordprocessing ml subject - sections5   wordprocessing ml subject - sections
5 wordprocessing ml subject - sections
 
7 wordprocessing ml subject - fonts
7   wordprocessing ml subject - fonts7   wordprocessing ml subject - fonts
7 wordprocessing ml subject - fonts
 
0 wordprocessing ml overview
0   wordprocessing ml overview0   wordprocessing ml overview
0 wordprocessing ml overview
 
css.pdf
css.pdfcss.pdf
css.pdf
 
Cascading Style Sheets(CSS)
Cascading Style Sheets(CSS)Cascading Style Sheets(CSS)
Cascading Style Sheets(CSS)
 
4 wordprocessing ml subject - custom markup
4   wordprocessing ml subject - custom markup4   wordprocessing ml subject - custom markup
4 wordprocessing ml subject - custom markup
 
Chapter 12: CSS Part 2
Chapter 12: CSS Part 2Chapter 12: CSS Part 2
Chapter 12: CSS Part 2
 
10 wordprocessing ml subject - footnotes and endnotes
10   wordprocessing ml subject - footnotes and endnotes10   wordprocessing ml subject - footnotes and endnotes
10 wordprocessing ml subject - footnotes and endnotes
 
Chapter 11: Intro to CSS
Chapter 11: Intro to CSSChapter 11: Intro to CSS
Chapter 11: Intro to CSS
 
Css
CssCss
Css
 
handout
handouthandout
handout
 
11 wordprocessing ml subject - glossary document
11   wordprocessing ml subject - glossary document11   wordprocessing ml subject - glossary document
11 wordprocessing ml subject - glossary document
 
DIGITAL DOCUMENTATION PPT
DIGITAL DOCUMENTATION PPTDIGITAL DOCUMENTATION PPT
DIGITAL DOCUMENTATION PPT
 
Publishing xml
Publishing xmlPublishing xml
Publishing xml
 
Cascading style sheets, Introduction to web programming
Cascading style sheets, Introduction to web programmingCascading style sheets, Introduction to web programming
Cascading style sheets, Introduction to web programming
 
Need for css,introduction to css & basic syntax wt
Need for css,introduction to css &  basic syntax wtNeed for css,introduction to css &  basic syntax wt
Need for css,introduction to css & basic syntax wt
 
Cs 371-lecture-02
Cs 371-lecture-02Cs 371-lecture-02
Cs 371-lecture-02
 
Text editing, analysis, processing, bibliography
Text editing, analysis, processing, bibliographyText editing, analysis, processing, bibliography
Text editing, analysis, processing, bibliography
 
Introducing Cascading Style Sheets
Introducing Cascading Style SheetsIntroducing Cascading Style Sheets
Introducing Cascading Style Sheets
 
Intro to css & sass
Intro to css & sassIntro to css & sass
Intro to css & sass
 

More from Shawn Villaron (15)

Spreadsheet ml subject shared workbooks
Spreadsheet ml subject   shared workbooksSpreadsheet ml subject   shared workbooks
Spreadsheet ml subject shared workbooks
 
Spreadsheet ml subject query table
Spreadsheet ml subject   query tableSpreadsheet ml subject   query table
Spreadsheet ml subject query table
 
Spreadsheet ml subject metadata
Spreadsheet ml subject   metadataSpreadsheet ml subject   metadata
Spreadsheet ml subject metadata
 
Spreadsheet ml subject comments
Spreadsheet ml subject   commentsSpreadsheet ml subject   comments
Spreadsheet ml subject comments
 
Spreadsheet ml subject calc chain
Spreadsheet ml subject   calc chainSpreadsheet ml subject   calc chain
Spreadsheet ml subject calc chain
 
Spreadsheet ml overview
Spreadsheet ml overviewSpreadsheet ml overview
Spreadsheet ml overview
 
Spreadsheet ml subject workbook
Spreadsheet ml subject   workbookSpreadsheet ml subject   workbook
Spreadsheet ml subject workbook
 
Spreadsheet ml subject workbook connections
Spreadsheet ml subject   workbook connectionsSpreadsheet ml subject   workbook connections
Spreadsheet ml subject workbook connections
 
Spreadsheet ml subject tables
Spreadsheet ml subject   tablesSpreadsheet ml subject   tables
Spreadsheet ml subject tables
 
Spreadsheet ml subject strings
Spreadsheet ml subject   stringsSpreadsheet ml subject   strings
Spreadsheet ml subject strings
 
Spreadsheet ml subject sheet
Spreadsheet ml subject   sheetSpreadsheet ml subject   sheet
Spreadsheet ml subject sheet
 
3 wordprocessing ml subject - tables
3   wordprocessing ml subject - tables3   wordprocessing ml subject - tables
3 wordprocessing ml subject - tables
 
16 wordprocessing ml subject - odds and ends
16   wordprocessing ml subject - odds and ends16   wordprocessing ml subject - odds and ends
16 wordprocessing ml subject - odds and ends
 
14 wordprocessing ml subject - settings
14   wordprocessing ml subject - settings14   wordprocessing ml subject - settings
14 wordprocessing ml subject - settings
 
13 wordprocessing ml subject - mail merge
13   wordprocessing ml subject - mail merge13   wordprocessing ml subject - mail merge
13 wordprocessing ml subject - mail merge
 

Recently uploaded

Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
Alluxio, Inc.
 

Recently uploaded (20)

Crafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM IntegrationCrafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM Integration
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
 
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
iGaming Platform & Lottery Solutions by Skilrock
iGaming Platform & Lottery Solutions by SkilrockiGaming Platform & Lottery Solutions by Skilrock
iGaming Platform & Lottery Solutions by Skilrock
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
AI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning Framework
 
GraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysisGraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysis
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
AI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in MichelangeloAI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in Michelangelo
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
 

6 wordprocessing ml subject - styles

  • 1. Components of WordprocessingML • Main Document • Paragraphs & Rich Formatting – Runs – Run Content • Tables • Custom Markup • Sections • Styles – Paragraph – Character – Numbering – Table – Document Defaults • Fonts • Numbering • Headers/Footers • Footnotes/Endnotes • Glossary Document • Annotations – Comments – Revisions – Bookmarks • Mail Merge • Document Settings – Web Settings – Compatibility Settings • Fields & Hyperlinks • Odds & Ends (Textboxes, Subdocuments, Extensibility) Ecma/TC45/2006/059 (Rev.)
  • 3. Style Information • A style defines a specific set of formatting properties – For example, the Normal style in Word 2003 is defined as: • Font = Times New Roman • Font Size = 12 point • Font Language = Language of Word (English (US) for me) • Justification = Left • Line Spacing = Single • Widow/Orphan control
  • 4. Styles Storage • Within a WordprocessingML package, styles are stored in a unique part – Target of an implicit relationship from the document part – Relationship type: http://schemas.openxmlformats.org/wordprocessingml/2006/st yles – Content type: vnd-openxmlformats.officedocument.wordprocessingml- styles+xml
  • 5. Styles Storage • Within the styles part, there are two primary components: – Style definitions – Latent style information
  • 6. Style Definitions • A style is defined using the style element • The style definition contains three pieces of information – Common style properties – Style 'type' – Type-specific properties
  • 7. Common Style Properties • All styles share a set of common properties: – Style name – Additional aliases – Style ID • This is what is used to reference this style from document content – Automatically redefine based on direct formatting – Hidden
  • 8. Common Style Properties • Common properties (cont'd): – Lock (prevent changes to style) – Priority (for user interface sorting) – Unhide when used (for user interface) – Semi-hidden – Revision ID (used to compare two instances of a style)
  • 9. Common Style Properties • ..and the most interesting two properties: – Parent style on which this style is based (which we'll discuss more later) – Is this style the default for its type? (i.e. is this the style that is applied when no style of this type is referenced by the content)
  • 10. Style Example Common properties: Style name Quick Format Revision ID
  • 11. Style Types • WordprocessingML supports the creation of six different types of styles: – Paragraph styles – Character styles – Linked styles (paragraph + character) – Table styles – List styles – Default paragraph + character properties
  • 12. Paragraph Styles • Paragraph styles apply to the contents of an entire paragraph as well as the paragraph mark – This means they can affect the paragraph properties as well as the text formatting – They cannot be applied to sub-paragraph ranges
  • 13. Paragraph Styles • A paragraph style has three defining characteristics: – It is specified using a type attribute of "paragraph" on the style element – It defines the paragraph style for the next paragraph – It contains both a set of run properties (rPr) and paragraph properties (pPr)
  • 14. Paragraph Styles • The run properties are the set of properties applied to each run in the paragraph
  • 15. Paragraph Styles Example • Consider a paragraph style "Test Paragraph Style" which defines: – Font: Algerian – Font Size: 20 – Font Color: Red – Paragraph Spacing: double – Paragraph Indent: 1" (first line)
  • 16. Paragraph Styles Example • In styles part: Common Properties Paragraph Properties Character (Run) Properties
  • 17. Paragraph Styles Example • In document part:
  • 18. Character Styles • Character styles apply to the contents of one or more runs which are explicitly given that character style – They can be applied to any run within the document – Cannot specify paragraph properties
  • 19. Character Styles • A character style has two defining characteristics: – It is specified using a type attribute of "character" on the style element – It contains only a set of run properties (rPr) • The run properties are the set of properties to each run who references the character style
  • 20. Character Styles Example • Consider a character style which is defined as follows: – Font: Courier New – Font Color: Yellow – Underline
  • 21. Character Styles Example • In styles part: Common Properties Character (Run) Properties
  • 22. Character Styles Example • In main document part:
  • 23. Linked Styles • Linked styles are a paired combination of both a paragraph and character style • This allows the style to be used in both paragraph and character contexts – When the current selection is a run, the character style is applied – When the current selection is a paragraph, the paragraph style is applied
  • 24. Linked Styles • Linked styles in WordprocessingML are literally two styles: one paragraph, one character • They are 'linked' using the link element • This tells the consumer that it should mask the fact that these are two different styles at runtime
  • 25. Linked Styles • The two are linked via the other's styleId
  • 26. Linked Style Example • Consider a linked style defined as follows: – Font: Arial (a character property) – Font Color: green (a character property) – Double spaced (a paragraph property) – 1" left indent (a paragraph property) • In the styles part, we get two style definitions:
  • 27. Linked Style Example • A paragraph style: Wants to link to a character style with styleID = "TestLinkedStyleChar"
  • 28. Linked Style Example • A character style: Wants to link to a paragraph style with styleID = "TestLinkedStyle"
  • 29. Linked Style Example • And each style can be referenced in the main document part:
  • 31. Numbering Styles • Numbering styles are styles which define the structure of a multi-level numbering format • They are an index into a numbering format that is stored with the document • The numbering style syntax is used to give the numbering style a persistent name, as well as specify common style properties
  • 32. Table Styles • Table styles supply formatting information for tables – e.g. borders, shading, etc. • As well, they provide formatting information for the text of the table's contents
  • 33. Table Styles • A table is associated with a style via the tblStyle element Associated Table Style Components of Table Style Used
  • 34. Table Styles • Although each of these properties are optional, their omissions each supply a default value: – Omitting tblStyle uses the default table style – Omitting tblLook specifies that all aspects of the table style should be included
  • 35. Table Sections • Table styles have all of the properties that can be applied to a table – Like paragraph styles and paragraph formatting • However, table styles allow for the definition of unique formats for different table 'sections' of the table
  • 36. Table Sections Within the main table rows, there are also table formatting properties for alternating rows and columns
  • 37. Table Sections banded row banded row even row stripe even row stripe
  • 38. Table Section Priorities 1.Top left, top right, bottom left, bottom right 2.First column, last column 3.First row, last row 4.Banded rows, even row banding 5.Banded columns, even column banding 6.Whole table (application order is bottom to top)
  • 39. Table Style Apply parts of table style with Table Look:
  • 40. Default Paragraph and Character Properties • Whew! The final type of style isn't really a style as much as a set of properties • Let's come back to this…
  • 41. Style Inheritance • Styles of any given type can inherit from other styles of that type. – e.g. The Tristan Test style can inherit from the Heading 1 paragraph style can be specified to inherit properties from the Normal paragraph style • This lineage is traced using the basedOn element, which specifies the styleId of the 'parent'
  • 42. Style Inheritance • To build up the resulting style: – Trace the hierarchy back to its root – Follow each level down, applying its properties – When properties conflict, they are overridden (this includes turning OFF a property set at an earlier level) • On save, properties that match those inherited are not explicitly saved for that style
  • 43. Default Paragraph and Character Properties • Now that we've covered style inheritance… • All styles eventually inherit back to a style which has no basedOn property • This means we need to have a default value for formatting properties – What would it mean if Font was never explicitly specified in a style hierarchy?
  • 44. Default Paragraph and Character Properties • These default properties are called the document defaults and are applied before any other formatting information • However, in previous versions of Word these defaults were coded into the EXE and could not be changed • In WordprocessingML, these defaults are stored in the styles part under the docDefaults element
  • 45. Default Paragraph and Character Properties default run properties default paragraph properties
  • 46. Style Application • Multiple style ‘types’ can be applied to the same text within a file, so properties are applied in a specific order. – As with inheritance, the resulting formatting properties set by one type can be removed or supplemented by following types.
  • 47. Style Application Table Characters Paragraph List Item Table Paragraph Character Direct Formatting Numbering Applicationorder Document Defaults
  • 48. Style Application • First, the document defaults are applied to text • Next, the table style properties are applied to each table in the document • Next, list item and paragraph properties are applied to each paragraph formatted with a list style • Next, paragraph and run properties are applied to each paragraph
  • 49. Style Application • Next, run properties are applied based on character styles • Finally, we apply direct formatting (paragraph or run properties not from styles) • It's important to remember that each level can *not* specify properties and get the properties from previous levels
  • 50. Latent Styles • The other piece of style information stored in the document • Stores properties about styles without saving the actual style in the file – e.g. for documents where formatting is restricted to a selection of styles – can this one be used? • Needed because the document may not have access to its template
  • 51. Latent Styles • Latent style properties: – Style lockdown (can style be used?) – UI sorting priority – Use as top-level format – Unhide when used
  • 52. Latent Styles • For efficiency, the latent style information is stored as a set of latent style defaults with exceptions defining properties for those styles which do not match the defaults
  • 53. Disclaimer This presentation is for informational purposes only, and should not be relied upon as a substitute or replacement for Microsoft formal file format documentation, which is available at the following website: https://msdn.microsoft.com/en- us/library/cc313118(v=office.12).aspx. Any views or opinions presented in this material are solely those of the author and do not necessarily represent those of Microsoft. Microsoft disclaims all liability for mistakes or inaccuracies in this presentation.