2

我有一個應用程序,它將以文本形式記錄文件 系統的目錄列表。也就是說,它應該這樣說:描述目錄樹文件​​屬性的XML語言?

File name is: abc.txt 
Last modification date is: 2009-12-31T01:23 
Read-only attribute is: True 
Hidden attribute is: False 

房源將持續數年的長期歸檔,所以語言應該是不言自明的未來的信息考古學家。該語言應該能夠描述常用PC平臺文件系統的最常用文件屬性:NTFS,FAT,HFS +,ext2/3等。它應該能夠處理非拉丁文件名,不同的時間戳語義在不同的文件系統上等等。

當然,對於構造這些數據的語言的明顯選擇是一些基於XML的語言 。任何人都可以指向一個已經存在 的語言來描述文件屬性的分層結構和 目錄屬性,就像在文件系統中一樣?我希望從語言設計者爲了獲得語義正確性,創建模式或DTD,制定出某件事是否應該是XML元素或屬性等方面的細節而受益。

我已經看着在明顯的地方:http://xml.coverpages.com,網絡 搜索引擎的XML-Lcomp.text.xml,這裏的檔案。我沒有找到這種語言的任何痕跡。搜索有點複雜,因爲搜索術語「文件屬性」在XML中使用的術語屬性獲得大量命中。

請建議我應該調查的語言。它有助於獲得語言的名稱,以及指向描述語言及其相關工具,語法定義等的URL的指針。

在此先感謝!

+0

我會在XML-DEV上發佈這個問題(http://www.xml.org/xml-dev/),如果你沒有得到有用的回覆,我會感到驚訝。如果沒有這方面的規範,那麼應該有,我希望OASIS的人蔘與。 [你可以說我建議。] – 2009-11-23 22:49:44

+0

經過太多的延遲,我將這個答案歸功於最好的。該清單並未指出我採用適當的格式,而且我也沒有成功讓OASIS參與其中。但是XML-DEV列表是一個非常有用的論壇。 – 2012-01-21 22:39:59

回答

1

大衛從XML-DEV列表李回答說:

在xmlsh的XLS命令正是這樣做的,但我不會認爲這是專爲長期存檔使用的格式。 這可能是對你有用,也可能沒有

http://www.xmlsh.org

示例輸出

xls -l 


<dir> 
<file name="README.txt" path="C:/Work/DEI/xmlsh/trunk/README.txt" length="191" type="file" readable="true" writable="true" executable="true" mtime="2008-11-10T11:18:59"/> 
<file name="_dist" path="C:/Work/DEI/xmlsh/trunk/_dist" length="0" type="dir" readable="true" writable="true" executable="true" mtime="2009-11-23T10:38:00"/> 
<file name="_out" path="C:/Work/DEI/xmlsh/trunk/_out" length="0" type="dir" readable="true" writable="true" executable="true" mtime="2009-11-23T10:38:04"/> 
<file name="bin" path="C:/Work/DEI/xmlsh/trunk/bin" length="0" type="dir" readable="true" writable="true" executable="true" mtime="2009-11-23T10:26:06"/> 
<file name="build-lib" path="C:/Work/DEI/xmlsh/trunk/build-lib" length="0" type="dir" readable="true" writable="true" executable="true" mtime="2009-11-01T11:57:19"/> 
<file name="build.xml" path="C:/Work/DEI/xmlsh/trunk/build.xml" length="3732" type="file" readable="true" writable="true" executable="true" mtime="2009-11-14T12:31:37"/> 
<file name="doc" path="C:/Work/DEI/xmlsh/trunk/doc" length="0" type="dir" readable="true" writable="true" executable="true" mtime="2009-11-01T11:56:17"/> 
<file name="lib" path="C:/Work/DEI/xmlsh/trunk/lib" length="0" type="dir" readable="true" writable="true" executable="true" mtime="2009-11-20T07:56:56"/> 
<file name="license.txt" path="C:/Work/DEI/xmlsh/trunk/license.txt" length="1540" type="file" readable="true" writable="true" executable="true" mtime="2009-04-09T09:15:50"/> 
<file name="notices" path="C:/Work/DEI/xmlsh/trunk/notices" length="0" type="dir" readable="true" writable="true" executable="true" mtime="2009-11-20T07:49:36"/> 
<file name="out.txt" path="C:/Work/DEI/xmlsh/trunk/out.txt" length="0" type="file" readable="true" writable="true" executable="true" mtime="2009-11-23T20:44:33"/> 
<file name="samples" path="C:/Work/DEI/xmlsh/trunk/samples" length="0" type="dir" readable="true" writable="true" executable="true" mtime="2009-05-27T11:36:54"/> 
<file name="schemas" path="C:/Work/DEI/xmlsh/trunk/schemas" length="0" type="dir" readable="true" writable="true" executable="true" mtime="2008-05-26T20:36:41"/> 
<file name="sh_histo" path="C:/Work/DEI/xmlsh/trunk/sh_histo" length="23" type="file" readable="true" writable="true" executable="true" mtime="2009-11-23T11:02:38"/> 
<file name="src" path="C:/Work/DEI/xmlsh/trunk/src" length="0" type="dir" readable="true" writable="true" executable="true" mtime="2009-03-20T10:21:07"/> 
<file name="test" path="C:/Work/DEI/xmlsh/trunk/test" length="0" type="dir" readable="true" writable="true" executable="true" mtime="2009-10-29T11:14:29"/> 
<file name="unix" path="C:/Work/DEI/xmlsh/trunk/unix" length="0" type="dir" readable="true" writable="true" executable="true" mtime="2009-11-16T15:17:48"/> 
<file name="win32" path="C:/Work/DEI/xmlsh/trunk/win32" length="0" type="dir" readable="true" writable="true" executable="true" mtime="2009-09-20T07:54:55"/> 
<file name="xmlsh.log" path="C:/Work/DEI/xmlsh/trunk/xmlsh.log" length="116538" type="file" readable="true" writable="true" executable="true" mtime="2009-11-23T20:44:31"/> 
</dir> 
0

彼得的XML-L名單弗林好心向我指出。我發現目錄生成在繭:http://cocoon.apache.org/2.1/userdocs/directory-generator.html

它根據他們顯示有一個DTD生成XML目錄列表,但這裏有一個例子:

<dir:directory xmlns:dir="http://apache.org/cocoon/directory/2.0" 
    name="stylesheets" lastModified="1056668768203" date="27.06.03 01:06" size="0" 
    requested="true" sort="name" reverse="false"> 
    <dir:directory name="sites" lastModified="1056668768203" date="27.06.03 01:06" size="0"/> 
    <dir:file name="dynamic-page2html.xsl" lastModified="1056668768203" date="27.06.03 01:06" size="4321"/> 
    <dir:file name="simple-xml2html.xslt" lastModified="1056668768203" date="27.06.03 01:06" size="1234"/> 
</dir:directory> 

還有一個XPath的目錄發電機: cocoon.apache.org/2.1/userdocs/xpathdirectory-generator。html

他們的總結是:「XPath目錄生成器提供目錄生成器的所有功能,另外還可以從目錄生成器找到的XML文件中獲取XML片段。它產生的目錄列表,如下面的例子:

<dir:directory xmlns:dir="http://apache.org/cocoon/directory/2.0" 
    name="articles" lastModified="1057183738609" date="03.07.03 00:08" size="0" 
    requested="true" sort="name" reverse="false"> 
    <dir:directory name="images" lastModified="1057183738609" date="03.07.03 00:08" size="0"/> 
    <dir:file name="article1.xml" lastModified="1057183738609" date="03.07.03 00:08" size="123"> 
    <dir:xpath query="/article/title"> 
     <title>My first article!</title> 
    </dir:xpath> 
    </dir:file> 
    <dir:file name="article2.html" lastModified="1057183738609" date="03.07.03 00:08" size="345"/> 
    <dir:file name="article2.xml" lastModified="1057183738609" date="03.07.03 00:08" size="234"> 
    <dir:xpath query="/article/title"> 
     <title>My second article!</title> 
    </dir:xpath> 
    </dir:file> 
</dir:directory> 

我覺得這個怎麼樣的語言有趣的是,他們把所有的文件屬性的XML實體屬性,而不是標籤之間。我對XML語言設計非常幼稚,所以我不知道每種方法的優缺點。但這正是我希望搭載別人的語言設計的原因。