LibreOffice:生成幻灯片的XSLT样式表? [英] LibreOffice: a XSLT stylesheet to generate a slideshow?

查看:153
本文介绍了LibreOffice:生成幻灯片的XSLT样式表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

libreoffice 文档是一个zip文件,其中(其中包括)一些XML文件.

A libreoffice document is a zip file containing (among other thing) some XML files.

s$ unzip -t test.odp
Archive:  test.odp
    testing: mimetype                 OK
    testing: Configurations2/statusbar/   OK
    testing: Configurations2/accelerator/current.xml   OK
    testing: Configurations2/floater/   OK
    testing: Configurations2/popupmenu/   OK
    testing: Configurations2/progressbar/   OK
    testing: Configurations2/menubar/   OK
    testing: Configurations2/toolbar/   OK
    testing: Configurations2/images/Bitmaps/   OK
    testing: content.xml              OK
    testing: styles.xml               OK
    testing: meta.xml                 OK
    testing: settings.xml             OK
    testing: META-INF/manifest.xml    OK
No errors detected in compressed data of test.odp.

我想使用 XSLT (以及xsltproc +元素<xsl:document/>)从看起来像这样的xml文件中动态生成ODP幻灯片:

I would like to dynamically generate an ODP slideshow using XSLT (and the xsltproc + the element <xsl:document/> ) from a xml file that could look like this:

<slideshow>

  <slide>
    <title>Slide 1</title>
    <content>blablablablablablablabal</content>
  </slide>
  <!-- (....) --->
  <slide>
    <title>Slide N</title>
    <content>blablablablablablablabal</content>
  </slide>
</slidesho>

为此是否有任何现有的XSLT样式表?

Is there any existing XSLT stylesheet for this ?

文件 content.xml 很复杂,什么是可以工作的odp(HelloWorld.odp)的最小内容?

The file content.xml is complicated, what would be the minimal content for an odp, a HelloWorld.odp, that could work ?

推荐答案

最小有效的演示文件如下:

A minimial valid presentation file looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<office:document-content xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0">
  <office:body>
    <office:presentation/>
  </office:body>
</office:document-content>

具有一些基本内容的简单文件是这样的:

A simple file with some basic content would be this:

<?xml version="1.0" encoding="UTF-8"?>
<office:document-content office:version="1.2"
    xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
    xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
    xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
    xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
    xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0">
  <office:body>
    <office:presentation>
      <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>Title</text:p>
          </draw:text-box>
        </draw:frame>
        <draw:frame presentation:style-name="" svg:width="24.639cm"
          svg:height="12.178cm" svg:x="1.4cm" svg:y="4.914cm" presentation:class="subtitle">
          <draw:text-box>
            <text:p>My Text</text:p>
          </draw:text-box>
        </draw:frame>
      </draw:page>
    </office:presentation>
  </office:body>
</office:document-content>

我建议您使用支持ODF的XML编辑器,例如 oXygen .拥有要使用的ODF版本的规范和RNG 使用也可能有帮助.

I'd suggest getting an XML editor like oXygen that supports ODF to play with this. Having the specifications and RNG for the ODF version that you want to use might help, too.

这篇关于LibreOffice:生成幻灯片的XSLT样式表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆