Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #20350

Re: XSLT to Python script conversion?

Date 2012-02-13 11:28 -0500
From "Mike C. Fletcher" <mcfletch@vrplumber.com>
Subject Re: XSLT to Python script conversion?
References <jharfo$1rij$1@ns.felk.cvut.cz>
Newsgroups comp.lang.python
Message-ID <mailman.5763.1329150904.27778.python-list@python.org> (permalink)

Show all headers | View raw


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 
<http://bazaar.launchpad.net/%7Emcfletch/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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

XSLT to Python script conversion? Matej Cepl <mcepl@redhat.com> - 2012-02-13 12:20 +0100
  Re: XSLT to Python script conversion? Stefan Behnel <stefan_ml@behnel.de> - 2012-02-13 14:34 +0100
  Re: XSLT to Python script conversion? "Mike C. Fletcher" <mcfletch@vrplumber.com> - 2012-02-13 11:28 -0500
  Re: XSLT to Python script conversion? Tim Arnold <Tim.Arnold@sas.com> - 2012-02-15 12:48 -0500
    Re: XSLT to Python script conversion? Matej Cepl <mcepl@redhat.com> - 2012-02-16 18:17 +0100
      Re: XSLT to Python script conversion? Ross Ridge <rridge@csclub.uwaterloo.ca> - 2012-02-17 15:37 -0500
        Re: XSLT to Python script conversion? Stefan Behnel <stefan_ml@behnel.de> - 2012-02-17 21:53 +0100
          Re: XSLT to Python script conversion? Ross Ridge <rridge@csclub.uwaterloo.ca> - 2012-02-17 16:11 -0500

csiph-web