ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Cc: ntg-context@ntg.nl
Subject: Re: xml again
Date: Mon, 26 Nov 2001 15:22:30 +0100	[thread overview]
Message-ID: <5.1.0.14.1.20011126151307.03c6ceb0@server-1> (raw)
In-Reply-To: <01112417461400.00957@levana>

Hi Patrick and Taco,

I am currently using the xml stuff (again). It is so great!!! But there is
>one little problem:
>I have a line like this in my xml file:
>[...]
>
><technote longname="/Volumes/Share/pub/tn/tn1051_conic_splines"
>    shortname="tn1051_conic_splines.pdf" refname="tn1051_conic_splines"/>
>[...]

In your case, making the _ other is ok, but imagine such a thing showing up 
in normal text. This is why i map 'm on entities. Another reason is that as 
soon as such animals are written to as file and read in again, tex starts 
complaining about # and & and maybe some unbalanced {'s, depending on the 
text used. Now, such funny chars can be either mapped into an entity, or on 
a fake element (not yet in the distribution, think of something <*name>).

One can expand such mapped things under several regimes (more on that in 
the source). A very simple solution for your problem is:

\defineXMLentity [tex-hash]       {\letterhash}
\defineXMLentity [tex-dollar]     {\letterdollar}
\defineXMLentity [tex-percent]    {\letterpercent}
\defineXMLentity [tex-backslash]  {\letterbackslash}
\defineXMLentity [tex-hat]        {\letterhat}
\defineXMLentity [tex-underscore] {\letterunderscore}
\defineXMLentity [tex-leftbrace]  {\letterbgroup}
\defineXMLentity [tex-rightbrace] {\letteregroup}
\defineXMLentity [tex-bar]        {\letterbar}
\defineXMLentity [tex-tilde]      {\lettertilde}

\defineXMLsingular[test][oeps=,whow=,hm=]
   {\tttf \input \XMLop{oeps} [\XMLop{whow}] [\XMLop{hm}]}

\startXMLdata
<test oeps="oeps_tst.tmp" whow="#FFEEGG" hm="^{}~"/>
\stopXMLdata

Another option is (but i have to think that over first) is to have some 
fast switching mechanism between text representation and raw chars. Because 
these things are expandable, you can use them safely in tests and alike.

If needed, we can also make an \enablerawXML.. for pure database apps.

Btw, the _ is kind of special anyway; i'm thinking of making that one 
active by default.

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


      parent reply	other threads:[~2001-11-26 14:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-24 16:46 Patrick Gundlach
2001-11-26  9:12 ` Taco Hoekwater
2001-11-26 14:22 ` Hans Hagen [this message]

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=5.1.0.14.1.20011126151307.03c6ceb0@server-1 \
    --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).