我正在与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