当前位置:网站首页>Style Design Principles in Open Office XML Format
Style Design Principles in Open Office XML Format
2022-08-08 18:42:00 【Wang Zixi】
Microsoft Word has a full toolbar dedicated to styles: Normal, No Spacing, Heading 1, Heading 2, Heading, etc.These styles are stored in /word/styles.xml, an example is as follows:
Once there is text in the Word document with an additional style defined, we will find a reference to that style in the paragraph attribute tag
.Here is an example where I have defined my text with style heading 1:
The style definition of Heading1 itself is written in the file styles.xml
:
xpath specifies the font as bold,
Indicates the font color.
instructs MSWord to use the "normal" style for any missing attributes.
xpath specifies the font as bold, and
for the fontcolor.
instructs MSWord to use the "normal" style for any missing attributes.
PROPERTY INHERITANCE
There is a term in the field of Open Office XML Formatting called run: a simple document consists of paragraphs, a paragraph consists of a series of runs (a series of text with the same font, color, etc.), a run consists of characters (eg
) composition.The
tag may have several characters, and possibly several characters in the same run.
Text properties are inherited.Run has its own properties (w:p/w:r/w:rPr/*
), but it also inherits the properties of paragraphs (w:r/w:pPr/*
), and both can reference style properties from the file /word/styles.xml
.
Paragraphs and runs start with default properties: w:styles/w:docDefaults/w:rPrDefault/*
and w:styles/w:docDefaults/w:pPrDefault/*
code>.To get the final result of the character attributes, you should:
- Use default run/paragraph properties
- Add run/paragraph style properties
- Add local local run/paragraph properties
- Add results from paragraph properties
When you append
B to A mentioned above, it means to traverse all B properties and overwrite all A properties, leaving all disjoint properties as they are.
Characters in a run instance can inherit from its paragraphs, and can all inherit from styles.xml.
边栏推荐
猜你喜欢
随机推荐
微信小程序云开发 | 插件的微信小程序云开发
熬夜拜读349页阿里面试通关手册,成功闯入字节
常用字符的编码
uva1432
Shell脚本三剑客(grep、sed、awk)
2022年6月电子学会考级试卷真题解析(含答案和所有文档下载)
Shell编程之循环语句与函数
MySQL:Update高并发下变慢的案例及其涉及的特性
Redhat 7 Maria DB安装与配置
3D角色建模师和3D角色动画师哪个更有前景?哪个更适合小白入门?
数据压缩和归档(三)、tarfile
Laravel 5.8 Notes
内核实战教程第1期|数据库系统概述,带你走近 OceanBase 研发环境!
21天学习挑战赛——机器学习03
422B测试成功
QT With OpenGL (Bloom) (Bloom)
js温度计插件自定义数值
元宇宙三巨头Animoca Brands、Yuga Labs、Gala多维度对比,谁才是未来?
Why do you need to cross compiler
重读GPDB 和 TiDB 论文引发的 HTAP 数据库再思考