【发布时间】:2015-05-12 15:16:14
【问题描述】:
我有第一个这样的 XML TEI 文件:
<?xml version="1.0" encoding="UTF-8"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0">
<teiHeader xml:lang="en" />
<text>
<body>
<div type="chapter" n="1">
<p>
<s xml:id="e_1">In my younger and more vulnerable years my father gave me some advice that I've been turning over in my mind ever since.</s>
</p>
<p>
<s xml:id="e_2">"Whenever you feel like criticizing any one," he told me, "just remember that all the people in this world haven't had the advantages that you've had."</s>
</p>
</div>
<div type="chapter" n="2">
<p>
<s xml:id="e_3">In my younger and more vulnerable years my father gave me some advice that I've been turning over in my mind ever since.</s>
</p>
<p>
<s xml:id="e_4">"Whenever you feel like criticizing any one," he told me, "just remember that all the people in this world haven't had the advantages that you've had."</s>
</p>
</div>
</body>
</text>
</TEI>
然后,我有第二个这样的 XML TEI 文件:
<?xml version="1.0" encoding="UTF-8"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0">
<teiHeader xml:lang="en" />
<text>
<body>
<div type="chapter" n="1">
<p>
<s xml:id="f_1">explanation of the sentence e_1.</s>
</p>
<p>
<s xml:id="f_2">explanation of the sentence e_2</s>
</p>
</div>
<div type="chapter" n="2">
<p>
<s xml:id="f_3">explanation of the sentence e_1.</s>
</p>
<p>
<s xml:id="f_4">explanation of the sentence e_2</s>
</p>
</div>
</body>
</text>
</TEI>
第二个文件包含对第一个文件的一些解释。我想知道是否可以在这两个文件之间进行交叉引用?在 XML 中执行此操作的常用/最佳方法是什么? TEI 有什么特别之处吗?
【问题讨论】:
-
什么编程语言?您的样本没有结束标记,因此它无效。我假设您只发布了实际文件的一部分。我会使用“使用 'div' 和 'chapter' 编号加入。如果您发布包含多个的更大样本,我会有所帮助。
-
@jdweng 我已经更正了 xml 示例。该文件是重复的,我已经制作了第二个
div。 PHP 会很棒。 -
我不是 PHP 人。通常在 C# 中执行此操作。我会在您的请求中为 PHP 添加一个额外的标签。
标签: xml cross-reference tei