9

I have discovered quite a number of documents at the PRAGMA ADE Web page, showing how to create documents using an XML system. Much of the documents show features, such as tables, which appear, at least at first glance, easier to construct using ConTeXT's typical non-XML commands, such as those found in the tables article of the ConTeXt wiki.

  • How does this XML system integrate with the rest of ConTeXt?
  • Why would anyone use such a system?
  • In what situations might be it be benefitial to use this instead of standard ConTeXt macros?
1
  • I've never tried it, but I can imagine processing, for example, DocBook with Context. (Thus having a single source for "traditional" typesetting and for publishing on the Intertubes) Apr 29, 2012 at 12:32

1 Answer 1

15

How does this XML system integrate with the rest of ConTeXt?

It integrates extremely well through special xmlsetups. These setups let you define the behaviour for every element of the input tree. For more info consult the Context XML documentation or ask on the list.

Why would anyone use such a system?

Because you can rarely demand that the input be TeX, can you? It doesn’t matter if it appeals to you, the fact is that nothing short of ASCII is more common than XML. Say, for example, you want to process a web site or an RSS feed. Would you want to convert the XML to TeX markup yourself or just run it though your TeX format?

In what situations might be it be benefitial to use this instead of standard ConTeXt macros?

As long as you can choose, the only benefit is learning how. I wrote a 30-page XML document once in order to teach myself XML processing in Context. I found myself defining lots of extra tags and entities to compensate for the lack of flexibility (example: bibliography stuff). -- I was essentially writing Context code in disguise, because from the beginning it was clear that this was the only target. But now I can define typesetting directives for just about every website in a matter of minutes.

In short: Rarely anyone would, given the choice, pick XML as an input format emself, but Context’s XML facilities (there’s a backend as well) allow you safely interact with the rest of the world.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .