How to show xml element include other element

asgatan

New Member
XML Example: (From Webster Dictionary API)\[code\]<entry_list version="1.0"> <entry id="dictionary"> <term> <hw>dictionary</hw> </term> <fl>noun</fl> <sens> <mc> a reference book giving information about the meanings, pronunciations, uses, and origins of words listed in alphabetical order </mc> <vi> try to develop the habit of going to the <it>dictionary</it> whenever you encounter an unfamiliar word </vi> <syn>lexicon, wordbook</syn> <rel> gloss, glossary, nomenclator, thesaurus, vocabulary </rel> </sens> </entry></entry_list>\[/code\]So how could I use ElementTree in Python to show:\[code\]<vi> try to develop the habit of going to the <it>dictionary</it> whenever you encounter an unfamiliar word</vi>\[/code\]I tried to use foobar.findtext('vi') while the answer is:\[code\]try to develop the habit of going to the\[/code\]All I need is the full one.
 
Back
Top