Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!tudelft.nl!txtfeed1.tudelft.nl!multikabel.net!newsfeed20.multikabel.net!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: 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; 'subject:Python': 0.05; '(currently': 0.07; 'python': 0.08; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:script': 0.09; 'thoughts?': 0.09; 'discourages': 0.16; 'from:addr:behnel.de': 0.16; 'from:addr:stefan_ml': 0.16; 'from:name:stefan behnel': 0.16; 'received:mnet-online.de': 0.16; 'switching': 0.16; 'this?': 0.19; 'seems': 0.20; 'appropriate': 0.22; 'header:In-Reply-To:1': 0.22; 'stefan': 0.24; 'script': 0.28; 'alternatives': 0.29; 'easier.': 0.30; 'porting': 0.30; 'least': 0.30; 'xml': 0.31; 'subject:?': 0.31; 'does': 0.32; 'header:User-Agent:1': 0.33; 'it?': 0.33; 'header:X-Complaints-To:1': 0.34; 'problem.': 0.35; 'to:addr :python-list': 0.35; 'received:org': 0.36; 'using': 0.37; 'another': 0.37; 'could': 0.38; 'getting': 0.38; 'url:org': 0.39; 'processing': 0.39; 'received:de': 0.39; 'to:addr:python.org': 0.40; 'more': 0.61; 'your': 0.61; 'share': 0.66; 'received:93': 0.79; 'xslt': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Stefan Behnel Subject: Re: XSLT to Python script conversion? Date: Mon, 13 Feb 2012 14:34:08 +0100 References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: ppp-93-104-18-155.dynamic.mnet-online.de User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20120129 Thunderbird/10.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1329140063 news.xs4all.nl 6891 [2001:888:2000:d::a6]:57471 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:20344 Matej Cepl, 13.02.2012 12:20: > I am getting more and more discouraged from using XSLT for a transformation > from one XML scheme to another one. Could you explain what it is that discourages you about it? That would allow us to come up with better alternatives for your specific problem. > Does anybody could share any experience > with porting moderately complicated XSLT stylesheet > (https://gitorious.org/sword/czekms-csp_bible/blobs/master/CEP2OSIS.xsl) > into a Python script using ElementTree's interparse or perhaps xml.sax? > > Any tools for this? Speed differences (currently I am using xsltproc)? Any > thoughts? You could try switching to lxml. It would at least allow you to do a part of the processing in Python and only use XSLT when it seems more appropriate and/or easier. Stefan