Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Peter Otten <__peter__@web.de> Newsgroups: comp.lang.python Subject: Re: delete from pattern to pattern if it contains match Date: Thu, 21 Apr 2016 13:24:08 +0200 Organization: None Lines: 38 Message-ID: References: <20c0b0fe-136b-4b01-b004-c55c6d47b299@googlegroups.com> <91432d7b-7233-4504-a725-22bc81637ea3@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Trace: news.uni-berlin.de nm0gDs1BGDxYXhdq37tyCgvKVpCsg1BRas/hdNbEAMXw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'orange': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'xml.': 0.09; '2016': 0.16; 'file?': 0.16; 'fruit': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'received:t-ipconnect.de': 0.16; 'wrote:': 0.16; 'tree': 0.18; 'all,': 0.20; 'file:': 0.22; 'parsing': 0.22; 'xml': 0.24; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'earlier': 0.27; 'but': 0.36; 'instead': 0.36; 'monday,': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'doing': 0.38; 'end': 0.39; 'why': 0.39; 'data': 0.39; 'subject:from': 0.39; 'to:addr:python.org': 0.40; 'received:de': 0.40; 'leading': 0.61; 'email addr:gmail.com': 0.62; 'below.': 0.66; 'utc+5:30,': 0.84 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: p57bd9dc0.dip0.t-ipconnect.de User-Agent: KNode/4.13.3 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <20c0b0fe-136b-4b01-b004-c55c6d47b299@googlegroups.com> <91432d7b-7233-4504-a725-22bc81637ea3@googlegroups.com> Xref: csiph.com comp.lang.python:107447 harirammanohar@gmail.com wrote: > On Monday, April 18, 2016 at 12:38:03 PM UTC+5:30, hariram...@gmail.com > wrote: >> HI All, >> >> can you help me out in doing below. >> >> file: >> >> guava >> fruit >> >> >> mango >> fruit >> >> >> orange >> fruit >> Is that literally what you have in the file? > any one can guide me ? why xml tree parsing is not working if i have > root.tag and root.attrib as mentioned in earlier post... The data above is not valid xml. Instead of ... you need ... i. e. the end tag must be the same as the start tag, but with a leading "/".