清單的格式是XML,我遇到的問題不在於XML的建構怎麼寫,
而是有沒有好用的XML資料檢視程式?
可以透過簡單的定義就可以有一個圖形化的檢視程式。
Tellico is a KDE application for organizing your collections.
在Tellico中:
- collection是資料樣板,類似於OOP中的class
- entry是資料,類似於OOP中的instance
先定義collection fields
entry圖形化編輯視窗就出現了
產生的tellico.xml如下
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE tellico PUBLIC '-//Robby Stephenson/DTD Tellico V11.0//EN' 'http://periapsis.org/tellico/dtd/v11/tellico.dtd'> | |
<tellico xmlns="http://periapsis.org/tellico/" syntaxVersion="11"> | |
<collection title="My Collection" type="1"> | |
<fields> | |
<field title="ID" flags="32" category="Personal" format="4" type="6" name="id"> | |
<prop name="template">%{@id}</prop> | |
</field> | |
<field title="Title" flags="8" category="General" format="1" type="1" name="title"/> | |
<field title="Date Created" flags="16" category="Personal" format="3" type="12" name="cdate"/> | |
<field title="Date Modified" flags="16" category="Personal" format="3" type="12" name="mdate"/> | |
<field title="Author" flags="0" category="General" format="4" description="" type="1" name="author"/> | |
<field title="Page" flags="0" category="General" format="4" description="New Field 1" type="6" name="page"/> | |
<field title="Files" flags="1" category="Files" format="4" description="New Field 1" type="8" name="files"> | |
<prop name="columns">1</prop> | |
</field> | |
<field title="frontcover" flags="0" category="frontcover" format="4" description="New Field 1" type="10" name="frontcover"/> | |
</fields> | |
<entry id="0"> | |
<id>0</id> | |
<title>testbook1</title> | |
<cdate calendar="gregorian"> | |
<year>2011</year> | |
<month>08</month> | |
<day>10</day> | |
</cdate> | |
<mdate calendar="gregorian"> | |
<year>2011</year> | |
<month>08</month> | |
<day>10</day> | |
</mdate> | |
<author>testAuthor1</author> | |
<page>9999</page> | |
<frontcover>file:///home/misawa/Downloads/40380e9d619b4ce435226699e9382c8a.jpg</frontcover> | |
</entry> | |
<images> | |
<image width="1600" format="jpeg" height="1200" link="true" id="file:///home/misawa/Downloads/40380e9d619b4ce435226699e9382c8a.jpg"/> | |
</images> | |
</collection> | |
</tellico> |
有幾個要注意的地方:
- Tellico會在每個collection fields中自動加入cdate, mdate這兩個element,在collection fields中看不到,也不能刪除,所以用script產生XML要記得每個entry都要包含cdate, mdate這兩個element
- field type = image的話會在collection加入subelement <images>
- 修改已經存在的collection會有個小問題, 如果之前的圖片都是以連結的方式儲存,那修改collection後可能會把圖片從外部
包裹進*.tc檔案裡,這個要看Tellico的設定
*.tc檔案格式:
- 是一個ZIP壓縮的檔案
- 裡面會有一個tellico.xml的檔案
- 如果圖片是選擇Store images in date file的話,會多個images目錄
目前看起來都還不錯,不過缺點是:
- 遇到大量資料可能就不行了= =|||(沒辦法底層是XML)
- 只能在Linux下跑
Reference:
沒有留言:
張貼留言