Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #55768
| Path | csiph.com!eeepc.pasdenom.info!news.pasdenom.info!news.dougwise.org!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <python-python-list@m.gmane.org> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.002 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'library': 0.06; 'dictionary': 0.07; 'dict': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'this:': 0.10; '270': 0.16; '272': 0.16; 'like?': 0.16; 'subject:XML': 0.16; 'daniel': 0.21; 'trying': 0.22; 'stefan': 0.23; 'header:In-Reply-To:1': 0.23; 'input': 0.25; 'to:addr:python-list': 0.31; "i've": 0.31; 'source': 0.31; 'header:X-Complaints-To:1': 0.32; 'convert': 0.33; 'file': 0.34; 'there': 0.34; 'header:User-Agent:1': 0.34; 'received:org': 0.35; 'received:de': 0.37; 'skip:t 20': 0.38; 'xml': 0.39; 'subject:: ': 0.39; 'header:Mime-Version:1': 0.39; 'to:addr:python.org': 0.40; 'skip:1 10': 0.61; 'received:188': 0.66; 'skip:2 20': 0.67; 'skip:1 20': 0.72 |
| X-Injected-Via-Gmane | http://gmane.org/ |
| To | python-list@python.org |
| From | Stefan Behnel <stefan_ml@behnel.de> |
| Subject | Re: XML to dict(d) |
| Date | Mon, 31 Jan 2011 14:08:02 +0100 |
| References | <4D46AF07.6000108@danielstender.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Gmane-NNTP-Posting-Host | ppp-188-174-40-127.dynamic.mnet-online.de |
| User-Agent | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Lightning/1.0b2 Thunderbird/3.1.7 |
| In-Reply-To | <4D46AF07.6000108@danielstender.com> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1498.1296479294.6505.python-list@python.org> (permalink) |
| Lines | 34 |
| NNTP-Posting-Host | 82.94.164.166 |
| X-Trace | 1296479294 news.xs4all.nl 41117 [::ffff:82.94.164.166]:41432 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:55768 |
Show key headers only | View raw
Daniel Stender, 31.01.2011 13:45: > we are trying to convert a Sanskrit dictionary which is in a "homegrown" XML format into dict(d), > the input file goes like this: > > <cut> > <H2><h><hc3>200</hc3><key1>akAlikam</key1><hc1>2</hc1><key2>a-kAlikam</key2></h><body> > <lex>ind.</lex> <c>immediately</c> <ls>MBh.</ls> </body><tail><mul/> <MW>000173</MW> <pc>2,2</pc> > <L>266</L></tail></H2> > <H2><h><hc3>110</hc3><key1>akAlya</key1><hc1>2</hc1><key2>a-kAlya</key2></h><body> <lex>mfn.</lex> > <c>unseasonable.</c> </body><tail><mul/> <MW>000174</MW> <pc>2,2</pc> <L>267</L></tail></H2> > <H1><h><hc3>110</hc3><key1>akAsAra</key1><hc1>1</hc1><key2>a-kAsAra</key2></h><body> <lex>m.</lex> > <c>N._of_a_teacher</c> <ls>BhP.</ls> </body><tail><mul/> <MW>000175</MW> <pc>2,2</pc> > <L>268</L></tail></H1> > <H1><h><hc3>110</hc3><key1>akiYcana</key1><hc1>1</hc1><key2>a-kiYcana</key2></h><body> > <lex>mfn.</lex> <c>without_anything_,_utterly_destitute</c> </body><tail><pc>2,2</pc> > <L>269</L></tail></H1> > <H1A><h><hc3>100</hc3><key1>akiYcana</key1><hc1>1</hc1><key2>a-kiYcana</key2></h><body> <lex > type="inh">mfn.</lex> <c>disinterested</c> </body><tail><pc>2,2</pc> <L>270</L></tail></H1A> > <H1B><h><hc3>110</hc3><key1>akiYcana</key1><hc1>1</hc1><key2>a-kiYcana</key2></h><body> > <lex>n.</lex> <c>that_which_is_worth_nothing.</c> </body><tail><MW>000176</MW> <pc>2,2</pc> > <L>271</L></tail></H1B> > <H3><h><hc3>110</hc3><key1>akiYcanatA</key1><hc1>3</hc1><key2>a-kiYcana--tA</key2></h><body> > <lex>f.</lex> <OR/> > <c>voluntary_poverty_<p>as_practised_by_<as0>Jaina</as0><as1><s>jEna</s></as1>_ascetics</p>.</c> > </body><tail><MW>000177</MW> <pc>2,2</pc> <L>272</L></tail></H3> > </cut> > > I've found that there is the library python-dictdlib for concatenating dict dictionaries, what would > be the best way to "de-XML" the source file? How do you want to the dict to look like? Stefan
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: XML to dict(d) Stefan Behnel <stefan_ml@behnel.de> - 2011-01-31 14:08 +0100
csiph-web