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; 7+ 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] 7+ messages in thread

* BibTeX and ConTeXt
  2002-07-10 16:45 Handling XML docs scarsoluigi
@ 2002-07-10 18:00 ` Glenn R. Williams
  2002-07-11  5:30   ` Berend de Boer
  2002-07-10 20:37 ` Handling XML docs Simon Pepping
  1 sibling, 1 reply; 7+ messages in thread
From: Glenn R. Williams @ 2002-07-10 18:00 UTC (permalink / raw)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi All,

Does anyone know the state of the bib module? I was able to get it to output 
the citations correctly, but can't seem to get it to generate the 
"References" section using \completepublications. The title "References" 
comes out, but the page is blank. Here's my setup:

\usemodule[bib]
\input toysbib.tex
\setuppublications
  [numbering=yes,
   sort=author]
.
.
.
\completepublications
- ---------------------------------------------
The \input file contains:

\startpublication
  [k=Brodie84,
   t=article,
   a=L.~Brodie,
   y=1984,
   s=LB84]
  \artauthor[]{Leo}[L.]{}{Brodie}
  \arttitle{Thinking Forth, a language and philosophy for solving problems}
  \journal{Prentice Hall}
  \pubyear{1984}
\stoppublication

\startpublication
  [k=Bekke92,
   t=article,
   a=J.H.~ter~Bekke,
   y=1992,
   s=JB92]
  \artauthor[]{Johan}[J.H.]{ter}{Bekke}
  \arttitle{Semantic datamodeling}
  \journal{Prentice Hall}
  \pubyear{1992}
\stoppublication

TIA,

Glenn
- -- 
Glenn R Williams
- ---------------------------------------------------------------------------------
"Mathematical theories are the part of science you could continue to do 
if you woke up tomorrow and discovered the universe was gone" 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9LHZCw/Wcp38R/MkRAnYGAKCmE9g0j3JM63TLsY0n3xKHck2dJACfXkay
zDnOJGNrNQmkT0grz8m4hK0=
=B93W
-----END PGP SIGNATURE-----


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

* Re: Handling XML docs.
  2002-07-10 16:45 Handling XML docs scarsoluigi
  2002-07-10 18:00 ` BibTeX and ConTeXt Glenn R. Williams
@ 2002-07-10 20:37 ` Simon Pepping
  1 sibling, 0 replies; 7+ messages in thread
From: Simon Pepping @ 2002-07-10 20:37 UTC (permalink / raw)


Luigi,

You try to automate things a lot. But you use a type of XML that I do
not favor; it is a mixture of XML and tex. My XML would be something
like this:

<node frame="top" backgroundcolor="cyan" rulethickness="3pt">
0 lev.
<node frame="bottom" backgroundcolor="magenta" rulethickness="3pt">
I lev.
<node frame="left" backgroundcolor="yellow" rulethickness="3pt">
II lev.
<node frame="right" backgroundcolor="darkgray" rulethickness="3pt">
(yes it's gray)III lev.</node>
</node>
</node>
</node>

And then your context mapping should translate this to context's
\framedtext command and its settings, using \processaction, string
comparison, \mapXMLvalue, etc.

Regards, Simon

On Wed, Jul 10, 2002 at 06:45:42PM +0200, scarsoluigi@libero.it wrote:
> 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

-- 
Simon Pepping
email: spepping@scaprea.hobby.nl


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

* Re: BibTeX and ConTeXt
  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
  0 siblings, 1 reply; 7+ messages in thread
From: Berend de Boer @ 2002-07-11  5:30 UTC (permalink / raw)
  Cc: ntg-context

"Glenn R. Williams" <gloonie@telocity.com> writes:

> \usemodule[bib]
> \input toysbib.tex

I suspect that this sould be

\setupbibtex
  [database={toysbib},
   sort=author]

> \setuppublications
>   [numbering=yes,
>    sort=author]

The bibtex module works perfectly well. 

Or perfect, some entries are quoted strange, articles change from
uppercase to all lowercase, whatever, I've to figure out why that
happens, but citations are all right.

-- 
Live long and prosper,

Berend de Boer


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

* Re: BibTeX and ConTeXt
  2002-07-11  5:30   ` Berend de Boer
@ 2002-07-11 17:12     ` Glenn R. Williams
  2002-07-11 20:02       ` Berend de Boer
  0 siblings, 1 reply; 7+ messages in thread
From: Glenn R. Williams @ 2002-07-11 17:12 UTC (permalink / raw)
  Cc: ntg-context

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I tried Berend's suggestion, but it didn't quite work. Maybe I'm doing 
something else wrong! When I use the \input toysbib.tex command, I get the 
cites but nothing in the "References" section except the title. 

However, when I try using setupbibtex, I get nothing (the cites have Xxxxxxx 
in them). Here's the complete setup I'm using. (My bbl file is called 
toysbib.tex).

1. toysbib.tex:

\startpublication
  [k=Brodie84,
   t=article,
   a=L.~Brodie,
   y=1984,
   s=LB84]
  \artauthor[]{Leo}[L.]{}{Brodie}
  \arttitle{Thinking Forth, a language and philosophy for solving problems}
  \journal{Prentice Hall}
  \pubyear{1984}
\stoppublication

\startpublication
  [k=Bekke92,
   t=article,
   a=J.H.~ter~Bekke,
   y=1992,
   s=JB92]
  \artauthor[]{Johan}[J.H.]{ter}{Bekke}
  \arttitle{Semantic datamodeling}
  \journal{Prentice Hall}
  \pubyear{1992}
\stoppublication

2. After my \startenvironment:

\usemodule[bib]
\setupbibtex
  [database={toysbib},
   sort=author]

3. In my preface:

       I've read only two books in my life \cite[Bekke92,Brodie84]. But I
       admit that I no longer think Forth \cite[Brodie84]. And I am
       grateful to NLP for their inspiration. 

4. After my \startbackmatter:

   \completepublications

5. I run this by:

   texexec --once toys
   bibtex toys
   texexec --pdf toys

   The bibtex step returns:

This is BibTeX, Version 0.99c (Web2C 7.3.1)
The top-level auxiliary file: toys.aux
The style file: cont-no.bst
Database file #1: toysbib.bib

Any ideas?

Regards,

Glenn

On Thursday 11 July 2002 01:30 am, Berend de Boer wrote:
>
> I suspect that this sould be
>
> \setupbibtex
>   [database={toysbib},
>    sort=author]
>

- -- 
Glenn R Williams
- ---------------------------------------------------------------------------------
"Mathematical theories are the part of science you could continue to do 
if you woke up tomorrow and discovered the universe was gone" 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9Lbxqw/Wcp38R/MkRAiP3AJwOaLD4NS/YbrP6Tq24PGDl+gSeKQCfcfyp
+5BXmgq66AP477wK8Cj5NO8=
=GLza
-----END PGP SIGNATURE-----


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

* Re: BibTeX and ConTeXt
  2002-07-11 17:12     ` Glenn R. Williams
@ 2002-07-11 20:02       ` Berend de Boer
  0 siblings, 0 replies; 7+ messages in thread
From: Berend de Boer @ 2002-07-11 20:02 UTC (permalink / raw)
  Cc: ntg-context

"Glenn R. Williams" <gloonie@telocity.com> writes:

> However, when I try using setupbibtex, I get nothing (the cites have Xxxxxxx 
> in them). Here's the complete setup I'm using. (My bbl file is called 
> toysbib.tex).

Ah, my setup assumed you had a real bibtex file. Perhaps you can try
to create one?

-- 
Live long and prosper,

Berend de Boer


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

* Re: Handling XML docs.
@ 2002-07-11  5:32 scarsoluigi
  0 siblings, 0 replies; 7+ messages in thread
From: scarsoluigi @ 2002-07-11  5:32 UTC (permalink / raw)
  Cc: ntg-context

> Luigi,
> 
> You try to automate things a lot. But you use a type of XML that I do
> not favor; it is a mixture of XML and tex. My XML would be something
> like this:
> 
> <node frame="top" backgroundcolor="cyan" rulethickness="3pt">
> 0 lev.
> <node frame="bottom" backgroundcolor="magenta" rulethickness="3pt">
> I lev.
> <node frame="left" backgroundcolor="yellow" rulethickness="3pt">
> II lev.
> <node frame="right" backgroundcolor="darkgray" rulethickness="3pt">
> (yes it's gray)III lev.</node>
> </node>
> </node>
> </node>
> 
> And then your context mapping should translate this to context's
> \framedtext command and its settings, using \processaction, string
> comparison, \mapXMLvalue, etc.
> 
> Regards, Simon

Absolutly good. 

Yesterday I forget to write that attr. type is CDATA and
is the only way to specified  formatting parameter
(well, i think to <para> element in docbook and role attribute)

thanks
luigi


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

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

Thread overview: 7+ 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
2002-07-11  5:32 scarsoluigi

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