我正在與OSIS(開放聖經信息標準)合作,這是描述聖經及相關文本的XML模式。當我第一次看到XML的一個樣本時,我注意到了一些我以前從未見過的古怪事物。主要標籤被關閉,然後邏輯上屬於封閉標籤內的內容。在看完documentation後,我發現他們稱這種標記爲「里程碑」。XML:跨越其他元素的里程碑或元素
在這種情況下,它被使用,因爲報價可以在一節開始,並在關閉之前跨越幾節經文。這看起來像一個黑客,我將不得不做一些編碼來解析和搜索,並顯示Web的XML的部分。雖然我明白這是技術上有效的XML,但無法正確驗證架構是否正確,並且標準XML解析API無法抓取里程碑之間的元素。我相信有這種「標準」可以形成的更好的方式。你對這種標記有什麼想法?我還沒有真正發現任何其他參考這種做法,其他地方使用它。它有效嗎?
從文檔...
在XML元素 的正常形式是開始標記和結束標記: <q> ... </Q >。但是,爲了處理 跨越邊界的標記,必須使用特殊的 表單。它由兩個 完全爲空的實例組成,其中 元素類型:一個用於標記起始點 ,另一個用於標記結束點 。兩個空元素識別 本身哪個是開始 並且其端部,並通過SID屬性 (傳統元件的開始) 和的eID屬性共同確定 本身(的傳統元素 結尾),其值 必須匹配。
空元素在XML由 指示以 「/」 的最終 之前的標籤 「>」:因此< Q/>而非<q>或 </Q >。以這種方式使用的元件 通常被稱爲「里程碑,」和 在OSIS那些特定元素 許可證此替代編碼是 因此被稱爲「milestoneable。」
下面是一個簡單的例子。 ..
<verse osisID="Acts.7.2" sID="a72"/>To this he replied:
<speech who=」Stephan」>Brothers and fathers, listen to me! The God of glory appeared
to our father Abraham while he was still in Mesopotamia, before he lived in Haran
<verse eID=」a72」/>
...
<verse osisID="Acts.7.6" sID="a76"/>God spoke to him in this way: <q
type=」embedded」 marker=」'」>Your descendants will be strangers in a country not
their own, and they will be enslaved and mistreated four hundred years. <verse
eID="a76"/>
<verse osisID="Acts.7.7" sID="a77"/>But I will punish the nation they serve as
slaves,</q> God said, <q type=」embedded」 marker=」'」>and afterward they will come out
of that country and worship me in this place.</q><verse eID="a77"/>
...
<verse osisID="Acts.7.53" sID="a79"/>you who have received the law that was put
into effect through angels but have not obeyed it.
<verse eID="a79"/>
</speech>
你有沒有進一步與此? – Private 2015-10-13 09:27:21