ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Handling XML docs.
@ 2002-07-10 16:45 scarsoluigi
  2002-07-10 18:00 ` BibTeX and ConTeXt Glenn R. Williams
  2002-07-10 20:37 ` Handling XML docs Simon Pepping
  0 siblings, 2 replies; 6+ messages in thread
From: scarsoluigi @ 2002-07-10 16:45 UTC (permalink / 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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-07-11 20:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-10 16:45 Handling XML docs scarsoluigi
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

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).