【发布时间】:2016-07-24 07:05:46
【问题描述】:
我有一个 XML 文档,其文档结构包含章节、段落、文章、章节、小节等元素。我想为这些元素中的部分文本提供意义。
例如,部分文本可能显示为“参考区域内的建筑物不得高于 25m。”。我想引用“25”并将其赋予“最大建筑高度”的含义,因此它是机器可解释的。我可以通过在文本中添加 XML 元素来做到这一点。例如:
<text>A building within the referenced area may no not be higher than <meaning type="max building height">25</meaning>m.</text>
我更愿意将含义与文本分开,如果可能的话,与原始 XML 文档分开。是否可以在另一个 XML 文档的元素中引用部分文本?
示例源文档:
<document>
<chapter id="5"><text>Building regulations</text>
<article id="102"><text>Build</text>
<section id="1a">
<text>A building within the referenced area may no not be higher than 25m.</text>
</section>
</article>
</chapter>
</document>
示例意义文档:
<meaning>
<reference type="max building height" ref="..." start="..." end="..." />
</meaning>
【问题讨论】:
-
你能附上你的文件的sn-p吗?
-
添加了一个简化的例子。
-
我不明白,你引用一个文本“参考区域内的建筑物可能不高于25m”然后说'我要参考“10”',没有
10在引用的文本中。 -
从文本中提取数据在任何语言中都不是一个好主意(当然,除非您没有其他选择)。建筑法规的第 5 章/第 102 条/第 1a 节是否已经暗示了最大建筑高度?如果是这样,那么围绕这些构建你的逻辑。
-
@MartinHonnen 对不起我的错误。已更正。
标签: xml