ODT

ODF(OpenOffice.org Open Document)是一种office文档的格式,现在已经被OASIS(The Organization for the Advancement of Structured Information Standards,很巧,我老是也是这个名字,呵呵)通过了,成为了Office文档的标准,请注意,这里的office可不是ms office。

事实上,ms office的标准是不公开的,而 ODF却是可以被公众浏览的,所以大家可以基于ODF的标准,进行定制开发。ODF已经被OO2和KOffice的下一个版本采用。

今天简单的看了看ODF的标准,觉得挺像FF的扩展的。ODF的定义是:a royalty-free, XML-based file format that covers features required by text, spreadsheets, charts, and graphical documents。可以看出,它是基于xml格式的,换句话说,它类似于html格式的超文本页面,但它的格式要求更加严格,一定是良构的,此外,还有一些样式的xml文件,这个类似于xsl文件,定义一些主xml文件的样式之类的。

举一个简单的helloworld例子吧。例如有一个hello.odt文件,其实它是一个zip格式的压缩文件。解压后,可以发现有一系列的文件和目录。挑重要的说罢吧。

  • mimetype

这个是唯一的非xml文件,它只是说明了该odf文件的类型。例如,文本处理文件的内容为 application/vnd.oasis.opendocument.text。

  • META-INFmanifest.xml

这个文件在META-INF目录中,它列出了odf文件的压缩包中所有的文件和目录集合。

  • meta.xml

该文件类似于odf文件的摘要,列出了文件作者、时间等信息。

  • settings.xml

该文件列出odf文件的所有设置,就像一个配置文件。例如,列出了文档页面的长宽等信息。

  • styles.xml

这个文件有点类似于xsl文件(之所以不说类似于css文件是因为它是xml格式的@@),它给出了文档所需的样式。

  • content.xml

这个才是odt文档的主文件,给出了所有内容,当然是以xml格式的。

[coolcode lang=”xml”]

<office:document-content
xmlns:office=”urn:oasis:names:tc:opendocument:xmlns:office:1.0″
xmlns:style=”urn:oasis:names:tc:opendocument:xmlns:style:1.0″
xmlns:text=”urn:oasis:names:tc:opendocument:xmlns:text:1.0″
xmlns:table=”urn:oasis:names:tc:opendocument:xmlns:table:1.0″
xmlns:draw=”urn:oasis:names:tc:opendocument:xmlns:drawing:1.0″
xmlns:fo=”urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0″
xmlns:xlink=”http://www.w3.org/1999/xlink”
xmlns:dc=”http://purl.org/dc/elements/1.1/”
xmlns:meta=”urn:oasis:names:tc:opendocument:xmlns:meta:1.0″
xmlns:number=”urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0″
xmlns:svg=”urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0″
xmlns:chart=”urn:oasis:names:tc:opendocument:xmlns:chart:1.0″
xmlns:dr3d=”urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0″
xmlns:math=”http://www.w3.org/1998/Math/MathML”
xmlns:form=”urn:oasis:names:tc:opendocument:xmlns:form:1.0″
xmlns:script=”urn:oasis:names:tc:opendocument:xmlns:script:1.0″
xmlns:ooo=”http://openoffice.org/2004/office”
xmlns:ooow=”http://openoffice.org/2004/writer”
xmlns:oooc=”http://openoffice.org/2004/calc”
xmlns:dom=”http://www.w3.org/2001/xml-events”
xmlns:xforms=”http://www.w3.org/2002/xforms”
xmlns:xsd=”http://www.w3.org/2001/XMLSchema”
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
office:version=”1.0″>

<style:font-face style:name="Times New Roman"
svg:font-family=”‘Times New Roman'”
style:font-family-generic=”roman”
style:font-pitch=”variable”/>
<style:font-face style:name="Arial"
svg:font-family=”Arial” style:font-family-generic=”swiss”
style:font-pitch=”variable”/>
<style:font-face style:name="SimSun"
svg:font-family=”SimSun” style:font-family-generic=”system”
style:font-pitch=”variable”/>
<style:font-face style:name="Tahoma" svg:font-family="Tahoma"
style:font-family-generic=”system” style:font-pitch=”variable”/>

Hello world!

ssssss

[/coolcode]

基本上就是这样了,还是很清晰的。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值