いろいろ試してみましたが、の内容を抽出できませんでしhead
た。誰か助けますか?
元のXML: https ://dl.dropbox.com/u/3482709/English_sense_induction.xml.zip
テキストは次のとおりです。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE corpus SYSTEM "sense-induction.dtd">
<corpus lang="en">
<lexelt item="explain.v">
<instance id="explain.v.4" corpus="wsj">
For OPEC , that 's ideal . The resulting firm prices and stability `` will allow both producers and consumers to plan confidently , '' says Saudi Arabian Oil Minister Hisham Nazer . OPEC Secretary-General Subroto <head> explains </head> : Consumers offer security of markets , while OPEC provides security of supply . `` This is an opportune time to find mutual ways { to prevent } price shocks from happening again , '' he says . To promote this balance , OPEC now is finally confronting a long-simmering internal problem .
</instance>
<instance id="explain.v.10" corpus="wsj">
and given the right conditions , sympathetic to creating some form of life . Surely at some other cosmic address a Gouldoid creature would have risen out of the ooze to <head> explain </head> why , paleontologically speaking , `` it is , indeed , a wonderful life . '' Mr. Holt is a columnist for the Literary Review in London .
</instance>
<instance id="explain.v.76" corpus="wsj">
`` You ca n't build on your hit-and-miss five-seventeen '' . `` What are you playing '' ? ? Owen asked . `` I 'm just logging '' , the cowboy <head> explained </head> . `` I keep all these plays in this little black book , and I watch over a twelve-hour period to find out what numbers are repeating . But roulette 's not my game .
</instance>
</lexelt>
<lexelt item="position.n">
<instance id="position.n.288" corpus="wsj">
But not everybody was making money . The carnage on the Chicago Board Options Exchange , the nation 's major options market , was heavy after the trading in S&P 100 stock-index options was halted Friday . Many market makers in the S&P 100 index options contract had bullish <head> positions </head> Friday ,
</instance>
<instance id="position.n.123" corpus="wsj">
An explosion at the Microbiology and Virology Institute in Sverdlovsk released anthrax germs that caused a significant number of deaths . Since Mr. Shevardnadze did not address this topic before the Supreme Soviet , the Soviet Union 's official <head> position </head> remains that the anthrax deaths were caused by
</instance>
</lexelt>
</corpus>
編集
xml
問題は私が2番目の議論として忘れていたことでした:解決策はsoup = BeautifulSoup(xml_data, 'xml')