次の形式の巨大なxmlファイルがあります
<XML>
<Application id="1" attr1="some value" attr2="some val"..and many more attr also with nested tags inside application which might contain more attributes
</Application>
<Application id="2"attr1="some value" attr2="some val"..and many more attralso with nested tags inside application which might contain more attributes
</Application>
<Application id="3"attr1="some value" attr2="some val"..and many more attr also with nested tags inside application which might contain more attributes
</Application>
.... probably 10000 more Application entries
</XML>
各 Application タグにはコンテンツのない属性のみがありますが、属性を持つことができるネストされたタグも含まれており、属性の一部を解析して抽出する必要があります。次のスクリプトを使用しています。アプリケーション タグの小さなサブセットでは問題なく動作しますが、レコードが増えると非常に遅くなります。残念ながら、ファイル全体またはファイル。
これが私のスクリプトです。これをより良く行う方法についての提案は本当にありがたいです。