TEI「標準」で構造化されたxmlドキュメントがあります。おそらく知っている人もいるでしょう。これを別の XML 構造に変換する XSLT を作成しました。
しかし、私は問題に来ました。変換プロセスは、XML 構造の特定のノードに到達しません。
元のドキュメントは次のようになります。
<TEI xmlns="http://www.tei-c.org/ns/1.0" xmlns:tgl="http://******/namespaces /metadata/language/2010" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:tns="http://*****/namespaces/metadata/core/2010" xmlns:tgr="http://*****/namespaces/metadata/agent/2010" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:tgs="http://*****/namespaces/metadata/script/2010" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xml:id="tg397" n="/Literatur/M/Birlinger, Anton/Märchen und Sagen/Sagen, Märchen, Volksaberglauben/3./299. Von den Sternen/2. [Die Sterne halten Viele für die Köpfe silberner Nägel]">
<teiHeader xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:a="http://www.*****/namespace/digibib/authors" xmlns:fn="http://www.w3.org/2005/xpath-functions">
<fileDesc>
<titleStmt>
<title> hshshhshs </title>
</titleStmt>
<publicationStmt>
....
XSLT を使用して、いくつかのノードに到達しようとしています。そうではないので、簡単な例を試してみましたが、の内容にたどり着けません。これは XSLT です。
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
<!--<xsl:template match="/TEI">-->
<xsl:template match="/">
<add><doc>
<field name="title">
<xsl:value-of select="TEI/teiHeader/fileDesc/titleStmt/title"/>
</field>-
</doc></add>
</xsl:template>
</xsl:stylesheet>
そして、これは結果です:
<?xml version="1.0" encoding="UTF-8"?>
<add>
<doc>
<field name="title"/>-
</doc>
</add>
あなたの誰かが私を助けてくれることを願っています。