テキスト値で xml 形式のファイルを検索し、その一部である ID を返すことができるようにしたいと考えています。私はxmlコマンドでpythonライブラリを調べましたが、要素/ノードによる検索の例しか見ませんでした。以下に簡単な xml サンプルを示します。たとえば、「3x3 Eyes」を検索して「2」を返したいと思います。また、大文字と小文字を区別しない正確なテキストも検索する必要があります。通常、各アニメの下にタイトルのエントリが複数あるため、最初の一致で検索を停止できます。ありがとう
<?xml version="1.0" encoding="UTF-8"?>
<animetitles>
<anime aid="1">
<title type="official" xml:lang="fr">Crest of the Stars</title>
<title type="official" xml:lang="fr">Crest of the Stars</title>
</anime>
<anime aid="2">
<title type="official" xml:lang="en">3x3 Eyes</title>
</anime>
<anime aid="3">
<title type="official" xml:lang="en">3x3 Eyes: Legend of the Divine Demon</title>
</anime>
</animetitles>