ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Christopher Creutzig <christopher@creutzig.de>
Subject: Re: DOC/RTF to ConTeXt via XML
Date: Tue, 27 Sep 2005 15:42:43 +0200	[thread overview]
Message-ID: <43394C53.3040309@creutzig.de> (raw)
In-Reply-To: <43391DCF.1010805@capdm.com>

Duncan Hothersall wrote:
> Well, XSLT seems to have been designed, and certainly tends to be
> implemented, as a tool for simple transformations of small XML chunks.

 No, xslt is a tool for arbitrary xml -> xml conversions (and a little
more than that).  With a good implementation (say, saxon), working with
moderately large trees is pretty fast.  The stylesheet is actually
compiled before running.

> Obviously complex transformations can be constructed from a bunch of
> simple transformations, but there comes a point when you should really

 Just about any programming language gives you simple operations to
build whatever you want from.

> just use a better tool - though these tend to cost serious money (e.g.

 „Better“ depends on your task at hand.

> OmniMark). Also, most XSLT implementations use the DOM model, which is

 XSLT uses a DOM model, which is different from the W3C DOM model.

> fine for a 50Kb file but will be incredibly resource-hungry if you're
> processing files of 5Mb. At that point you want a streaming model, and

 That depends on what you want to do with your data.  For many of my
needs, a streaming model simply wouldn't work without keeping lots of
information (to be processed later) in memory, defeating the model.

 I have found splitting my data into files that form conceptional units
to be a good way, both for editing the files and for turnaround times.
(I am using Makefiles, so the granularity of finding unchanged items for
me is the file.)  We are talking about almost 15MB here, which I regard
as pretty much, considering it is almost pure text.

 Again, I don't mind using something else on XML data.  I'm doing it
myself.  It all depends on what you want to do.  In the case of
transforming xml to ConTeXt, I would go for an xslt implementation, but
ymmv.  After all, the choice of tools always depends on many factors,
including familiarity.  (I've continued using perl instead of ruby for
ages, until recently, for that reason.)

> for a streaming model you want a better suited language than XSLT. As I
> say, horses for courses. For article-length pieces and simple
> transforms, XSLT might suffice.

 For number crunching, xslt is certainly inadequate.  Transforming books
of average length (say, 300-500 pages) is certainly doable, although I
would go for a transformation chapter-by-chapter,especially considering
that we are talking about a process where crossreferences etc. are going
to be handled later in the chain.  But I thought we were talking about
article-length pieces anyway?


Christopher

  reply	other threads:[~2005-09-27 13:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20050927100004.7F435127E5@ronja.ntg.nl>
2005-09-27 10:24 ` Duncan Hothersall
2005-09-27 13:42   ` Christopher Creutzig [this message]
     [not found] <20050928080211.5A0EB127F8@ronja.ntg.nl>
2005-09-28  8:54 ` Duncan Hothersall
2005-09-28 11:45   ` Christopher Creutzig
2005-09-27 15:10 Idris Samawi Hamid
2005-09-27 15:19 ` Adam Lindsay
2005-09-28  7:08 ` Christopher Creutzig
  -- strict thread matches above, loose matches on Subject: below --
2005-09-27 14:50 Idris Samawi Hamid
2005-09-28  8:02 ` Christopher Creutzig
     [not found] <20050927074229.9EF85127E2@ronja.ntg.nl>
2005-09-27  8:05 ` Duncan Hothersall
2005-09-27  9:03   ` Christopher Creutzig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43394C53.3040309@creutzig.de \
    --to=christopher@creutzig.de \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).