首页 文章

在openoffice / libreoffice文档中设置content.xml样式

提问于
浏览
0

这是我上一个问题的下一集LibreOffice: a XSLT stylesheet to generate a slideshow?

我现在用 XSLT 生成 content.xml .

libreoffice / content.xml中可以在 text:p 中添加 inline 样式 . 像 xhtml:span (见下文)?

<draw:page draw:master-page-name="">
    <draw:frame presentation:style-name="" svg:width="25.199cm"
      svg:height="3.506cm" svg:x="1.4cm" svg:y="0.837cm" presentation:class="title">
      <draw:text-box>
        <text:p>My name is <xhtml:span style="color:red;"><xsl:value-of select="name"/></xhtml:span></text:p>
      </draw:text-box>
    </draw:frame>
  </draw:page>

或者我需要在其他地方声明所有命名的样式吗?

1 回答

  • 2

    您可以在<text:p>中使用<text:span>,是的,您必须在其他地方声明所有命名样式 .

    当然,<text:span>需要一个结束标记 . 您需要使用正确的样式属性,这是非常重要的 . <xsl:value-of>元素也不会飞 . 我想你需要检查字段的ODF支持 .

    <text:span>元素的唯一属性最多只有一个文本:class-names和最多一个text:style-name .

    text:style-name值是随后在别处定义的样式的名称 . text:class-names属性是空格分隔的样式名称的值 .

    更多细节可以在ODF规范中找到 . 我推荐Office应用程序的OpenDocument格式(OpenDocument)版本1.2,第1部分 . 您可以在http://docs.oasis-open.org/office/v1.2/os/找到所有这些,包括完整的Zip . 您还可以通过在段落中的部分运行中设置一些属性来获取更多信息,并查看content.xml的内容以及最终定义的样式的定义位置 .

相关问题