[XML-SIG] Using xpath/xslt on proprietary object structures.

Alan Kernnedy pyxml@xhaus.com
Mon, 24 Sep 2001 08:43:19 +0100


"Thomas B. Passin" wrote:

> I'd reconsider using xslt.  There could be another approach that would make
> it work out.  I have a project where I produce a number of xml data files
> from a relational database, combine them, merge them into a template, merge
> that with hand-crafted text that is different for each different version I
> want to produce, then transform to html.  All this runs from one batch file,
> using four separate stylesheets.

Tom,

Thanks for the tips.

I fully recognise that the "design" of my app is less than optimal, and that one
of these days I need to rewrite it. I took my current path because I needed to
load lots of files several times. For example, the information in a "Paper
abstract" file needed to be included in a member's home page, AND used to
construct "Chapter" and "Book" style tables of contents, as well as be processed
into its own standalone page. I reasoned that loading each file once and always
working off the same copy would speed up the parsing load in the app.
Historical: I started using python before 4Suite was fully developed, and in
fact used JPython, Xerces and Xalan to do all the processing. Now that was a
memory hog! I switched to CPython and 4Suite when the memory usage of JPython
and the Apache went through the roof.

Taking my current approach of changing in "baby steps", my next step would be to
use XPATHs document() function to be transferring nodesets between DOMs at HTML
page generation time, rather than cutting and splicing chunks of DOM trees.

In the medium term, I do really need to get it into a database. I do need
multiple views of data, and database queries are the way to get them, not
writing a combination of Xpath and Python code.

In the longer term, I should really have a look at the more "exotic" features in
4Suite, such the XLink, DBDom and RDF support. I'm sure that they would enable
more elegant, compact and efficient solutions to my problems. It's just a case
of finding the time to investigate the capabilities of these modules, to see
what they can do.

Many thanks to all who offered tips and advice.

Cheers,

Alan.