2012-08-03 23 views
1

我想將一些簡單的格式應用於文本,但它不工作。示例如下,並通過RNG驗證程序。我正在使用Apache OpenOffice3.4和ODT1.2平面文檔。ODT和OpenOffice.org:將格式應用於文本下的文本:span使用文本:class-names屬性?

元素可以具有文本:class-names屬性;並且該屬性指定了以空格分隔的文本樣式名稱列表。

它看起來對我來說......這樣做的正確方法是什麼?

<?xml version="1.0" encoding="UTF-8"?> 
<office:document xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text"> 
    <office:styles> 
     <style:style style:family="text" style:name="BOLD"> 
      <style:text-properties fo:font-weight="bold"/> 
     </style:style> 
    </office:styles> 
    <office:body> 
     <office:text> 
      <text:p>Plain text here; <text:span text:class-names="BOLD">this is supposed to be bold text;</text:span></text:p> 
     </office:text> 
    </office:body> 
</office:document> 

回答

1

這是一個OOo/Libre bug and here's a link relating to the problem.不是在bugzilla中?

最初我嘗試使用嵌套的<text:span>元素,但是參考上面的鏈接,我在<office:styles>中定義了我的樣式,而不是<office:automatic-styles>

相關問題