当前位置:网站首页>How to describe multiple paragraphs with different font settings in Open Office XML format
How to describe multiple paragraphs with different font settings in Open Office XML format
2022-08-10 13:20:00 【Wang Zixi】
_rels.rels
This defines tell MS Word Where to find references to document content. In the following cases,它引用 word/document.xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="word/document.xml"/>
</Relationships>
_RELS/DOCUMENT.XML.RELS
This file defines resources that are embedded in the document content(例如图像)的引用. If our simple document has no embedded resources,Then the relationship label is empty:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
</Relationships>
[CONTENT_TYPES].XML
[Content_Types].xml Contains information about media types within the document. Because we only have text content,所以很简单:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
<Default Extension="xml" ContentType="application/xml"/>
<Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/>
</Types>
DOCUMENT.XML
This is the main one that contains the text content of the document XML. 在该文件中,Developers will find that some namespace references in the documentation are unused,但请注意,We should not delete them,因为 MS Word 需要它们.
Here is our simplified example:
<w:document>
<w:body>
<w:p w:rsidR="005F670F" w:rsidRDefault="005F79F5">
<w:r><w:t>Test</w:t></w:r>
</w:p>
<w:sectPr w:rsidR="005F670F">
<w:pgSz w:w="12240" w:h="15840"/>
<w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="720" w:footer="720" w:gutter="0"/>
<w:cols w:space="720"/>
<w:docGrid w:linePitch="360"/>
</w:sectPr>
</w:body>
</w:document>
主节点<w:document> represents the document itself,<w:body> 包含段落,嵌套在<w:body> in is by<w:sectPr> Defined page size.
<w:rsidR> is an ignorable property; 它被 MS Word 内部使用.
Let's look at a more complex document with three paragraphs. 我在 Microsoft Word is highlighted with the same color in the screenshot of XML,So we can see the correlation:


Word text in the document,Labels are paired w:t 包裹.字体通过 w:rFont 标签指定.
颜色通过 w:color 指定.
新的段落,通过 w:p 指定.w:p 里,仍然是 w:t.
Paragraph Structure
A simple document consists of paragraphs,A paragraph consists of a series(A series hassame font、color, etc. text)组成,A chain consists of characters(例如 <w:t>)组成.<w:t> There may be several characters inside the tag,在同一个 run There may be several characters in the structure.
TEXT PROPERTIES
The basic text attribute is the font、大小、颜色、样式等. 大约有 40 tags are used to specify the text appearance. As seen in our three paragraph example,每行在 <w:rPr> has its own properties,指定 <w:color>、<w:rFonts> 和粗体 <w:b>.
需要注意的重要一点是,The attribute distinguishes between two sets of characters,Normal scripts and complex scripts(例如阿拉伯语),And the properties have different tags,It depends on the type of characters it affects.
Most normal script attribute tags have a matching complex script tag,并添加了一个 C,Specifies that this property is used for复杂脚本. 例如:<w:i>(斜体)变为 <w:iCs>,Bold labels for normal scripts <w:b> into a complex script <w:bCs>.
边栏推荐
- 一个 CRM One Order Application log 的单元测试报表
- 商汤自研机械臂,首款产品是AI下棋机器人:还请郭晶晶作代言
- Blast!ByteDance successfully landed, only because the interview questions of LeetCode algorithm were exhausted
- Wirshark common operations and tcp three-way handshake process example analysis
- LeetCode简单题之合并相似的物品
- LeetCode中等题之颠倒字符串中的单词
- 神了!阿里数据库专家纯手写了这份604页的Oracle+MySQL攻坚指南
- Codeforces Round #276 (Div. 1) B. Maximum Value
- 机器学习实战(2)——端到端的机器学习项目
- ABAP 里文件操作涉及到中文字符集的问题和解决方案试读版
猜你喜欢

2022年8月中国数据库排行榜:openGauss重夺榜眼,PolarDB反超人大金仓

关于flask中static_folder 和 static_url_path参数理解

bgp dual plane experiment routing strategy to control traffic

神了!阿里数据库专家纯手写了这份604页的Oracle+MySQL攻坚指南

机器学习实战(2)——端到端的机器学习项目

Efficient and Robust 2D-to-BEV Representation Learning via Geometry-guided Kernel Transformer Paper Notes

Merge similar items in LeetCode simple questions

Proprietary cloud ABC Stack, the real strength!

代码随想录笔记_动态规划_70爬楼梯

Wirshark common operations and tcp three-way handshake process example analysis
随机推荐
Basic knowledge of switches
中科院深圳先进技术院合成所赵国屏院士组2022年招聘启事
ABAP 里文件操作涉及到中文字符集的问题和解决方案试读版
表中存在多个索引问题? - 聚集索引,回表,覆盖索引
查看 CUDA cudnn 版本 & 测试 cuda 和 cudnn 有效性「建议收藏」
神了!阿里数据库专家纯手写了这份604页的Oracle+MySQL攻坚指南
Network Saboteur
odps sql 不支持 unsupported feature CREATE TEMPORARY
机器学习实战(2)——端到端的机器学习项目
Detailed explanation of es6-promise object
11 + chrome advanced debugging skills, learn to direct efficiency increases by 666%
「网络架构」网络代理第一部分: 代理概述
10 款更先进的开源命令行工具
广东10个项目入选工信部2021年物联网示范项目名单
没有接班人,格力只剩“明珠精选”
iTextSharp操作PDF
Loudi Cosmetics Laboratory Construction Planning Concept
在web页面播放rtsp流视频(webrtc)
ArcMAP出现-15的问题无法访问[Provide your license server administrator with the following information:Err-15]
How to cultivate the design thinking of ui designers?