ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "scarsoluigi@libero.it" <scarsoluigi@libero.it>
Subject: Handling XML docs.
Date: Wed, 10 Jul 2002 18:45:42 +0200	[thread overview]
Message-ID: <GZ1L86$319134927A4C22094CCA2E145E47FAA6@libero.it> (raw)

Here some works on xml and context

setupcolors[state=start,rgb=no,cmyk=yes]
\defineXMLenvironment [node][type=]
{%Start tag
%{\ss\tfx attr type=''\XMLpar{node}{type}{}''}
\expanded{\beforesplitstring{\XMLpar{node}{type}{}}}\at [\to\Type%  
\expanded{\aftersplitstring{\XMLpar{node}{type}{}}}\at [\to\rawOptions%  
\expanded{\beforesplitstring{\rawOptions}}\at ]\to\Options%  
%{\ss\tfx Type=\Type}\par
%{\ss\tfx Option=\Options}\par
\doifelse{\Type}{framedtext}%
  {%then
  \expanded{\framed[\Options]}\bgroup
  }{%else
  \relax}
}
{%End tag
\egroup
 %%{\blank\ss$<$/node$>$\blank}
}

\starttext
\processXMLfilegrouped{test-5.xml}
{\tfx
\typefile{test-5.xml}}
\stoptext

and test-5.xml is 

<?xml version="1.0" ?>
<node type="framedtext[frame=off,topframe=on,
                       background=color,
                       backgroundcolor=cyan,
                       rulethickness=3pt]">
0 lev.
<node type="framedtext[frame=off,bottomframe=on,
                       background=color,
                       backgroundcolor=magenta,
                       rulethickness=3pt]">
I lev.
<node type="framedtext[frame=off,leftframe=on,
                       background=color,
                       backgroundcolor=yellow,
                       rulethickness=3pt]">
II lev.
<node type="framedtext[frame=off,rightframe=on,
                       background=color,
                       backgroundcolor=darkgray,
                       rulethickness=3pt]">
(yes it's gray)III lev.</node>
</node>
</node>
</node>

happy contexting
luigi


             reply	other threads:[~2002-07-10 16:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-10 16:45 scarsoluigi [this message]
2002-07-10 18:00 ` BibTeX and ConTeXt Glenn R. Williams
2002-07-11  5:30   ` Berend de Boer
2002-07-11 17:12     ` Glenn R. Williams
2002-07-11 20:02       ` Berend de Boer
2002-07-10 20:37 ` Handling XML docs Simon Pepping
2002-07-11  5:32 scarsoluigi

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='GZ1L86$319134927A4C22094CCA2E145E47FAA6@libero.it' \
    --to=scarsoluigi@libero.it \
    /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).