ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Adam Lindsay" <atl@comp.lancs.ac.uk>
Subject: Re: Antwort: Re: XML
Date: Fri, 23 Sep 2005 16:03:29 +0100	[thread overview]
Message-ID: <20050923150329.14468@mail.comp.lancs.ac.uk> (raw)
In-Reply-To: <BB6256EF-D81F-4ABA-A9EF-1DB497F2C5E7@fiee.net>

Henning Hraban Ramm said this at Fri, 23 Sep 2005 16:29:17 +0200:

>Am 2005-09-22 um 09:53 schrieb Jessica Holle:
>
>> There I don't find something which helps me.
>> The input must not be only XML. In can also be CVS or something
>> else...
>
>You will have to convert your XML file to become a ConTeXt table, use  
>XSLT or some scripting language.
>ConTeXt's TABLE format ("HTML tables") is very suitable for such.

I'm not sure I understand the "CVS or something else" part from the
original poster, but XML-style tables can very feasibly be mixed with
other ConTeXt code:

\usemodule        [contml]  % load the simple default xml vocab
\autoXMLnamespace [context] % avoid prefixing elements w/ context:
\setupcolors      [state=start] % not necessary, helps with example

\starttext
\section{Some \ConTeXt}

\startXMLdata
<table frame="off" background="color" color="white">
<tr backgroundcolor="red">   <td>some</td> <td>XML</td> </tr>
<tr backgroundcolor="green"> <td>xx</td> <td>xx</td> </tr>
</table>
\stopXMLdata

I can also have normal \TeX-like 
\inframed[frame=off,background=color,backgroundcolor=yellow]
{markup}.

\stoptext

>Is it possible to fill a table or a document in ConTeXt with content
>from a XML file?

You can replace the \startXMLdata-\stopXMLdata block with (in this case)
\processXMLfilegrouped{table.xml} where table.xml holds a table similar
to the above.
-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Adam T. Lindsay, Computing Dept.     atl@comp.lancs.ac.uk
 Lancaster University, InfoLab21        +44(0)1524/510.514
 Lancaster, LA1 4WA, UK             Fax:+44(0)1524/510.492
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

  reply	other threads:[~2005-09-23 15:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-22  7:53 Jessica Holle
2005-09-23 14:29 ` Henning Hraban Ramm
2005-09-23 15:03   ` Adam Lindsay [this message]
2005-09-23 19:33     ` 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=20050923150329.14468@mail.comp.lancs.ac.uk \
    --to=atl@comp.lancs.ac.uk \
    --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).