如何在 Libre Office Flat XML (fods) 文件中把一个字符串标记为粗体?

问题描述 投票:0回答:1

寻找 原地 XML.fods 文件。

  <table:table-column table:style-name="co1" table:default-cell-style-name="ce17"/>
  <table:table-row table:style-name="ro1">
    <table:table-cell table:style-name="ce15" office:value-type="string" calcext:value-type="string">
      <text:p>John Smith</text:p>
    </table:table-cell>
  </table:table-row>
  <table:table-row table:style-name="ro2">
    <table:table-cell table:style-name="ce16" office:value-type="string" calcext:value-type="string">
      <text:p>(123) 456-7890</text:p>
    </table:table-cell>
  </table:table-row>
  <table:table-row table:style-name="ro2">
    <table:table-cell office:value-type="string" calcext:value-type="string">
      <text:p>123 Main Street</text:p>
    </table:table-cell>
  </table:table-row>
  <table:table-row table:style-name="ro2">
    <table:table-cell office:value-type="string" calcext:value-type="string">
      <text:p>Anywhere, ZZ 12345-6789</text:p>
    </table:table-cell>
  </table:table-row>
  <table:table-row table:style-name="ro1">
    <table:table-cell table:style-name="ce15" office:value-type="string" calcext:value-type="string">
      <text:p>Jane Doe</text:p>
    </table:table-cell>
  </table:table-row>
  <table:table-row table:style-name="ro2">
    <table:table-cell table:style-name="ce16" office:value-type="string" calcext:value-type="string">
      <text:p>(234) 567-8901</text:p>

当打开 Libre Office 名字是黑体字。 这在上面会体现在哪里呢?XML? 我只看到一个 value-type="string" 而没有加粗、下划线等标记。

所有的东西都是单列的,所以不太清楚什么是 default-cell-style-name="ce17" 属性表示。

虽然数据的来源是 .doc 文件,我用的是 Libre Office 文件上的名字。

我想提取文件中的名字。XML这些数据与电话或地址的区别在于它们是粗体的。 我想也没有数字编号,但我想从电子表格中选择粗体数据。

我想选择电子表格中的粗体数据。格式化信息 似乎有些模糊。

格式化

样式和格式化控件很多,为信息的显示提供了很多控制。

页面布局是由各种属性控制的,包括页面大小、数字格式、纸盘、打印方向、页边距、边框(及其行宽)、padding、阴影、阴影、阴影等。这些属性包括页面大小、数字格式、纸盘、打印方向、页边距、边框(及其线宽)、填充、阴影、背景、列、打印页顺序、第一页编号、比例、表格居中、最大脚注高度和分隔符,以及许多布局网格属性。

页眉和页脚可以有定义的固定和最小高度、页边距、边框线宽度、padding、背景、阴影和动态间距。

对于特定的文本、段落、ruby文本、部分、表格、列、列表和填充有许多属性。特定的字符可以有它们的字体、大小、通用的字体家族名称(roman - serif, swiss - sans-serif, modern - monospace, decorative, script or system),以及其他属性设置。段落可以通过keep together、widow和orphan上的属性来控制其垂直空间,并有其他属性,如 "drop caps "来提供特殊的格式。这个列表非常广泛,详情请看参考文献(特别是实际标准)。

xml xml-parsing office365 libreoffice libreoffice-calc
1个回答
0
投票

值和格式被放置在XML文件的不同部分。

因此,通常,你有一个 "样式 "部分,所有的格式都用一个名称(style:name)来定义。

在表部分,你有表的定义,值放置在它和风格有(由他的'table:style-name'确定)。你可以为每个单元格、整行、整列甚至整个表格定义一个样式。

所以在你的情况下,你可以识别出粗体文本所使用的样式名称。这并不总是容易的,因为你可以为整个列行指定一个默认样式(default-cell-style-name="ce17"),在没有定义样式的情况下,它会发生。

我用Java开发了一个解析ODS文件的库,如果你需要灵感,可以在Github上查看。https:/github.commiachmSODS。

© www.soinside.com 2019 - 2024. All rights reserved.