ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <j.hagen@xs4all.nl>
To: ntg-context@ntg.nl
Subject: [NTG-context] Re: ConTeXt source from XML
Date: Wed, 5 Jun 2024 17:08:59 +0200	[thread overview]
Message-ID: <ba93d728-4254-4082-82b3-4c77bdf59ff8@xs4all.nl> (raw)
In-Reply-To: <937c365f-33c8-4052-8111-c6ac8dc91592@fiee.net>

On 6/5/2024 2:16 PM, Henning Hraban Ramm wrote:
> Am 05.06.24 um 12:00 schrieb Christoph Edenhauser:
>> My Question is, is it possible to generate a second context file2.tex 
>> with the help of this first xml-mapping file1.tex, where all the 
>> xml-nodes from the xml file are mapped to contex commands
> 
> Hi, I don’t find it hard to understand, but I don’t think it’s possible 
> within ConTeXt (while Hans keeps surprising me).
well, as one needs to do some work one can as well do this:

% oeps.tex

\startbuffer[test]
<something>
     <what>
         test
     </what>
</something>
\stopbuffer

\startxmlsetups xml:mysetups
     \xmlsetsetup{\xmldocument}{*}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:mysetups}

\startxmlsetups xml:something
     \tex{StartSomething}\par
     \xmlflush{#1}\par
     \tex{StopSomething}\par
\stopxmlsetups

\startxmlsetups xml:what
     \tex{StartWhat}\par
     \xmlflush{#1}\par
     \tex{StopWhat}\par
\stopxmlsetups

\setuppapersize[A1]
\setupbodyfont[dejavu,ss,1pt]
\setuplayout[tight]
\setupalign[verytolerant,flushleft,nothyphenated]

\starttext
     \xmlprocessbuffer{main}{test}{}
\stoptext

and then run

 >context oeps
 >mutool draw -F txt oeps.pdf

and get

\StartSomething
\StartWhat
test
\StopWhat
\StopSomething

so now you need to wikify it ...

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

  parent reply	other threads:[~2024-06-05 15:09 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-04 11:51 [NTG-context] " Christoph Edenhauser
2024-06-04 15:21 ` [NTG-context] " Pablo Rodriguez via ntg-context
2024-06-04 19:21   ` Christoph Edenhauser
2024-06-04 20:09     ` Hans Hagen
2024-06-05 10:00       ` Christoph Edenhauser
2024-06-05 12:16         ` Henning Hraban Ramm
2024-06-05 14:13           ` Christoph Edenhauser
2024-06-05 15:08           ` Hans Hagen [this message]
2024-06-05 14:34         ` Pablo Rodriguez via ntg-context
2024-06-05 18:23           ` Christoph Edenhauser
2024-06-06 15:33             ` Pablo Rodriguez via ntg-context
2024-06-06 15:42               ` Hans Hagen via ntg-context
2024-06-06 20:53               ` [NTG-context] " Christoph Edenhauser
2024-06-07 19:41                 ` [NTG-context] " Pablo Rodriguez via ntg-context
2024-06-07 20:34                   ` Henning Hraban Ramm
2024-06-08  7:14                   ` Denis Maier via ntg-context
2024-06-08  7:49                     ` Wolfgang Schuster
2024-06-08  8:49                       ` vm via ntg-context
2024-06-08  8:59                         ` Thomas A. Schmitz
2024-06-08  8:59                         ` Pablo Rodriguez via ntg-context
2024-06-08  9:04                       ` Pablo Rodriguez via ntg-context
2024-06-05 16:30       ` Pablo Rodriguez via ntg-context

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=ba93d728-4254-4082-82b3-4c77bdf59ff8@xs4all.nl \
    --to=j.hagen@xs4all.nl \
    --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).