根据TEI P5指南,我已经用xml对一本书进行了编码,并试图将其可视化到html页面中。真正的目的是可视化编码文本及其TEI P5指南的所有格式标签(文本格式、内部引用等)。因此,最大的问题是我们如何正确地做到这一点?
{记录在案:我已经尝试过(现在仍在尝试)将整个xml文本"抛出"到html主体中,并在并行css样式表中编辑可视化,我将其链接到html <style>
。但是,有些事情似乎不太对劲…}
有什么想法吗??是否有示例??
这里有一个xml示例:
<?xml version="1.0" ?>
<TEI version="5.0" xmlns="http://www.tei-c.org/ns/1.0">
<!--here exists the teiHeader-->
<text>
<front>
<div type="preface">
<head rend="align(center)">
<hi rend="bold">title</hi></head>
<p>Here is the prologue.Here is the prologue.</p>
<p>And second para of prologue.</p>
<p><ref target="#memories">Here is first reference to an xml:id, which have created to the teiHeader.</ref> Some more prologue. <ref target="#modernNovel">Here is the second reference to an xml:id, which have created to the teiHeader.</ref> and more prologue.</p>
<closer>
<salute rend="align(right)">Dear readers</salute>
<signed rend="align(right)">signature</signed>
</closer>
</div>
</front>
<body>
<ab type="title">
<title rend="align(center)" type="main">
TITLE
</title>
<lb/>
<title rend="align(center)" type="desc">
Secondary title
</title>
</ab>
<div n="1" type="chapter">
<head rend="align(center)">
<hi rend="bold">Chapter 1 <lb/>name of the chapter.</hi>
</head>
<p>Here is the real text, and text, and more text. Again the text, and text, and more text.Again the text, and text, and more text.An finally the name <placeName xml:id="London"> <hi rend="bold">London</hi></placeName>, appears here.</p>
<p>Here is the real text, and text, and more text. Again the text, and text, and more text.Again the text, and text, and more text.An the name <ref target="London"> <hi rend="bold">London</hi></ref>, repeat itself.</p>
</div>
</body>
您对@rend属性的使用表明您正试图使用它来提供CSS样式属性。如果是这样的话,您可能会发现使用@style或@rency属性更容易,因为这些属性是用于此目的的。但是请记住,这三个属性都用于描述源的格式副本。TEI(到目前为止)还没有提供指定如何处理文档的特定组件的方法:这被认为超出了原始项目的范围。然而,在为TEI要素定义"处理模型"方面正在开展工作,该模型应很快出现在《准则》中。例如,请参见TEI Simple项目。
是!我强烈建议您编写XSLT来将XML转换为HTML,因为这将使您能够最大限度地控制TEI元素在web浏览器中的呈现方式。它还使您可以生成多个不同的选项来构建和设置页面样式。
例如,如果您想提取TEI中标记的所有字符名称的列表,并计算它们在每一章中出现的次数,并进行其他类型的分析处理,XSLT就是您想要的工具并且您可以使用它生成文本的完整阅读视图。