[NTG-context] TeX control sequence inside XML param

Hans Hagen pragma at wxs.nl
Thu Jan 27 12:53:26 CET 2005


Vit Zyka wrote:
> Hallo,
> 
> it is possible to use TeX control sequence inside XML param? How?
> Example:
> 
> <figure file="file.pdf" width=".45\textwidth" />
>                                   ^^^^^^^^^^
> \defineXMLenvironment[figure][file=,width=]
>   {}
>   {\externalfigure[\XMLop{file}][width=\XMLop{width}]}

Hm. You're lucky. We should make a test suite (at the wiki) to make sure that 
this kind of stuff keeps working -)

\starttext

\defineXMLentity[ctx-var-textwidth] {\textwidth}

\defineXMLcommand[test][width=\textwidth]
   {\the\dimexpr\XMLop{width}\relax}

\startXMLdata
<test width=".45&ctx-var-textwidth;"/>
<test width="&ctx-var-textwidth;"/>
\stopXMLdata

\stoptext




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



More information about the ntg-context mailing list