ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: ntg-context@ntg.nl
Subject: Re: xml verbatim in xml...
Date: Wed, 9 Aug 2017 11:03:36 +0200	[thread overview]
Message-ID: <84e8c95f-b3ff-5bf4-433c-4e5f0acd5501@wxs.nl> (raw)
In-Reply-To: <b75e3204-27b9-d69d-6883-b07b220411e4@gmx.es>

On 8/8/2017 11:37 PM, Pablo Rodriguez wrote:
> On 08/08/2017 11:26 PM, Pablo Rodriguez wrote:
>> On 08/08/2017 10:46 PM, Schmitz Thomas A. wrote:
>>> Hi all,
>>>
>>> excellent excuse to pester the list with a program: it’s for my
>>> presentation at the ConTeXt meeting (have YOU registered yet?)…
>>> So: I want to show verbatim xml, and I’m writing in xml. This
>>> solution: http://wiki.contextgarden.net/Verbatim_XML mostly works
>>> (for Lua and TeX code), except for one little detail: for verbatim
>>> xml, it also prints the <xmlcode> tag. Example:
>> Thomas,
>>
>> \xmlprettyprint seems an easier approach.
>>
>> And I don’t know whether there might be a bug here, but your issue
>> arises when it contains XML tags:
> 
> Buffer in my previous sample was wrong (I modified something [to check
> whether the string "xml" was the cause] and I copied the wrong version):
> 
>      \startbuffer[test]
>      <a>
>        <texcode>
>        \starttext
>          \ConTeXt\ is awesome!
>        \stoptext
>        </texcode>
> 
>        <xmlcode>
>         <text>
>         <front>
>            ...
>         </front>
>         <body>
>            ...
>         </body>
>        </text>
>        </xmlcode>
>      </a>
>      \stopbuffer
> 
>      \startxmlsetups xml:testsetups
>          \xmlsetsetup{\xmldocument}{a/xmlcode}{xml:xmlcode}
>          \xmlsetsetup{\xmldocument}{a/texcode}{xml:texcode}
>      \stopxmlsetups
> 
>      \xmlregistersetup{xml:testsetups}
> 
>      \startxmlsetups xml:texcode
>          \xmlprettyprint{#1}{none}
>      \stopxmlsetups
> 
>      \startxmlsetups xml:xmlcode
>          \xmlprettyprint{#1}{none}
>      \stopxmlsetups
> 
>      \starttext
>          \xmlprocessbuffer{main}{test}{}
>      \stoptext

\startbuffer[test]
<a>
<texcode>
\starttext
     \ConTeXt\ is awesome!
\stoptext
</texcode>

<xmlcode>
     <text>
         <front>
             ...
         </front>
         <body>
             ...
         </body>
     </text>
</xmlcode>
</a>
\stopbuffer

\startxmlsetups xml:testsetups
     \xmlsetsetup{\xmldocument}{a/xmlcode}{xml:xmlcode}
     \xmlsetsetup{\xmldocument}{a/texcode}{xml:texcode}
\stopxmlsetups

\xmlregistersetup{xml:testsetups}

\startxmlsetups xml:texcode
     \xmlprettyprint{#1}{tex}
\stopxmlsetups

\startxmlsetups xml:xmlcode
     \xmlprettyprint{#1}{xml}
\stopxmlsetups

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


-----------------------------------------------------------------
                                           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 / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2017-08-09  9:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-08 20:46 Schmitz Thomas A.
2017-08-08 21:26 ` Pablo Rodriguez
2017-08-08 21:37   ` Pablo Rodriguez
2017-08-09  9:03     ` Hans Hagen [this message]
2017-08-09  9:41       ` Jean-Pierre Delange
2017-08-09 14:30       ` Pablo Rodriguez
2017-08-09  6:48   ` Schmitz Thomas A.
2017-08-12 14:03     ` Pablo Rodriguez

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=84e8c95f-b3ff-5bf4-433c-4e5f0acd5501@wxs.nl \
    --to=pragma@wxs.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).