Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!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.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'processing.': 0.03; 'repository': 0.05; 'subject:Python': 0.05; '(currently': 0.07; 'processing,': 0.07; 'python': 0.08; 'subject:script': 0.09; 'thoughts?': 0.09; 'url:launchpad': 0.09; 'am,': 0.12; '(now': 0.16; 'lives.': 0.16; 'nodes': 0.16; 'transforming': 0.16; 'url:bazaar': 0.16; 'url:blog': 0.17; 'wrote:': 0.18; 'this?': 0.19; 'header:In-Reply-To:1': 0.22; 'script': 0.28; 'fairly': 0.30; 'porting': 0.30; 'skip:_ 40': 0.30; 'xml': 0.31; 'subject:?': 0.31; 'does': 0.32; 'header:User-Agent:1': 0.33; 'hi,': 0.34; 'thank': 0.35; 'to:addr:python-list': 0.35; 'however,': 0.35; 'project': 0.35; 'but': 0.37; 'using': 0.37; 'another': 0.37; 'received:192': 0.38; 'mike': 0.38; 'could': 0.38; 'getting': 0.38; 'files': 0.39; 'url:org': 0.39; 'processing': 0.39; 'to:addr:python.org': 0.40; 'skip:s 40': 0.40; 'url:%0': 0.60; 'more': 0.61; 'our': 0.63; 'share': 0.66; 'direct': 0.67; 'header:Reply-To:1': 0.70; 'reply-to:no real name:2**0': 0.72; 'strategies': 0.82; 'received:192.168.15': 0.84; 'received:98.158': 0.84; 'xslt': 0.84 Date: Mon, 13 Feb 2012 11:28:49 -0500 From: "Mike C. Fletcher" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111229 Thunderbird/9.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: XSLT to Python script conversion? References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: mcfletch@vrplumber.com 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: 42 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1329150904 news.xs4all.nl 6847 [2001:888:2000:d::a6]:47510 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:20350 On 12-02-13 06:20 AM, Matej Cepl wrote: > Hi, > > I am getting more and more discouraged from using XSLT for a > transformation from one XML scheme to another one. 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? > > Thank you, > > Matěj I wound up rewriting the Docbook to XSL transformation for PyOpenGL's docs in Python using lxml.etree and Kid (now reworked to use Genshi). However, that was a fairly direct translation, it has only a handful of strategies for transforming nodes from docbook to xhtml. That said, it took our processing time down from so-long-I-just-didn't-want-to-work-on-the-docs down to regenerate-whenever-I-make-a-trivial-change. http://bazaar.launchpad.net/~mcfletch/pyopengl/directdocs/files Is the repository where the project lives. It *also* does a lot of other processing, but the generate.py, model.py and templates/section.kid files are all you need to look at to understand the docbook processing. HTH, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com