ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* xml again
@ 2001-11-24 16:46 Patrick Gundlach
  2001-11-26  9:12 ` Taco Hoekwater
  2001-11-26 14:22 ` Hans Hagen
  0 siblings, 2 replies; 3+ messages in thread
From: Patrick Gundlach @ 2001-11-24 16:46 UTC (permalink / raw)


Hi!

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"/>
[...]

and my tex-file looks like this:
--------------------------------
\setupexternalfigures[directory=/Volumes/Share/pub/tn/]

\defineoverlay[original][\overlaybutton{originaldest}]
\def\mytechnote{%
  \useexternaldocument[\XMLpar{technote}{refname}{}]
                      [\XMLpar{technote}{longname}{}]
  \definereference[originaldest][\XMLpar{technote}{refname}{}::]
  \framed[background=original,strut=no,offset=overlay]{%
    \externalfigure[\XMLpar{technote}{shortname}{}]%
                   [page=1,height=\textheight]}}
\defineXMLcommand [technote] \mytechnote

\starttext
\processXMLfilegrouped {filename.xml}
\stoptext
------------------------------------
and TeX gives me an error:
! Missing \endcsname inserted.
<to be read again> 
                   \unhbox 
\leavevmode ->\unhbox 
                      \voidb@x 
\_->\leavevmode 
                \kern .06em \vbox {\hrule width.3em}
\XML:ent:tex-underscore ...tterunderscore \else \_
                                                  \fi 
\XML:var:technote:refname ->tn1051_
                                   conic_splines
\XMLpar ...csname \@@XMLvariable :#1:#2\endcsname 
                                                  \else #3\fi 
...
l.51 ...ines.pdf" refname="tn1051_conic_splines"/>

it helps when I change things in xtags-ini.tex

[...] 
.unexpanded.gdef.enableXML*
[...]
   .catcode`._=.@@other* 
[...]
*   .catcode`._=.@@active .def_B&tex-underscore;E*
[...]

and recreate the format.

So it works for me, but I do not know if this is the preferred way to go.

Patrick, who is enjoying ConTeXt on his new iBook with MacOS X :-)


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

* Re: xml again
  2001-11-24 16:46 xml again Patrick Gundlach
@ 2001-11-26  9:12 ` Taco Hoekwater
  2001-11-26 14:22 ` Hans Hagen
  1 sibling, 0 replies; 3+ messages in thread
From: Taco Hoekwater @ 2001-11-26  9:12 UTC (permalink / raw)
  Cc: ntg-context

> it helps when I change things in xtags-ini.tex
> 
> [...] 
> .unexpanded.gdef.enableXML*
> [...]
>    .catcode`._=.@@other* 
> [...]
> *   .catcode`._=.@@active .def_B&tex-underscore;E*
> [...]

I head a similar problem with '#', under some circumstances. Hans, I believe the doubling is part of the log writing code, meaning that there is actually really just one hash mark in memory. That is quite important, because '#FFFFFF' (HTML color white) became '\getXMLentity{tex-hash}FFFFF' (I lost one F!). So I now have 

  .catcode`.#=.@@other

which it works flawlessly.

-- 
groeten,

Taco


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

* Re: xml again
  2001-11-24 16:46 xml again Patrick Gundlach
  2001-11-26  9:12 ` Taco Hoekwater
@ 2001-11-26 14:22 ` Hans Hagen
  1 sibling, 0 replies; 3+ messages in thread
From: Hans Hagen @ 2001-11-26 14:22 UTC (permalink / raw)
  Cc: ntg-context

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


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

end of thread, other threads:[~2001-11-26 14:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-24 16:46 xml again Patrick Gundlach
2001-11-26  9:12 ` Taco Hoekwater
2001-11-26 14:22 ` Hans Hagen

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