当前位置:网站首页>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>
.
边栏推荐
猜你喜欢
随机推荐
递归递推之递归的函数
47Haproxy Cluster
odps sql 不支持 unsupported feature CREATE TEMPORARY
Codeforces Round #276 (Div. 1) D. Kindergarten
22!Beijing Changping District notified catering service enterprises with food safety problems
【论文+代码】PEBAL/Pixel-wise Energy-biased Abstention Learning for Anomaly Segmentation on Complex Urban Driving Scenes(复杂城市驾驶场景异常分割的像素级能量偏置弃权学习)
Efficient and Robust 2D-to-BEV Representation Learning via Geometry-guided Kernel Transformer 论文笔记
LeetCode中等题之颠倒字符串中的单词
商汤自研机械臂,首款产品是AI下棋机器人:还请郭晶晶作代言
可视化服务编排在金融APP中的实践
一文详解 implementation api embed
【mysql索引实现原理】
数字藏品,“赌”字当头
Codeforces Round #276 (Div. 1) B. Maximum Value
Is there a problem with the CURRENT_TIMESTAMP(6) function?
海外邮件发送指南(二)
Jenkins修改端口号, jenkins容器修改默认端口号
需要被记录的OpenStack相关的命令_自己用
交换机的基础知识
rpn:def concat_box_prediction_layers