[NTG-context] XML-lookahead

Hans Hagen pragma at wxs.nl
Sun Aug 27 20:00:36 CEST 2006


Sjoerd Siebinga wrote:
> Thanks Hans, for the fast response.
> On 27-aug-2006, at 14:56, Hans Hagen wrote:
>
>> \disablemode[xml:linebreak]
>>
>>
>> \startsetups[xml:linebreak]
>>
>> � \doifmode{xml:linebreak}{\disablemode[xml:linebreak]\crlf} �
>>
>> \stopsetups�
>>
>>
>> \defineXMLenvironment [av] {} {\ensablemode[xml:linebreak]}
>>
>>
>> \defineXMLenvironment [liste] {\setups[xml:linebreak]} {\crlf}
>>
>>
>> or sometign similar, �
>>
>
> I have played around with this solution for a bit 
> and�\defineXMLenvironment [liste] {} {\setups[xml:linebreak]}
> �seems to work for the <liste>-tag. But it not entirely clear to me 
> how this should work for the <av>-tag when it is not followed by 
> another tag on the same line.�
\def\dowithnextXMLelement#1%
  {\pushmacro\executeXMLelement
   \def\executeXMLelement{#1\popmacro\executeXMLelement}}

\defineXMLenvironment[aap]
  {}
  {\dowithnextXMLelement
     {\doifelse{\currentXMLelement}{noot}
        { lust }
        { kust }}}

\starttext

\startXMLdata
    <aap>een aap</aap><noot>een noot</noot>
    <aap>een aap</aap><mies>een mies</mies>
\stopXMLdata

\stoptext

this assumes that i keep \executeXMLelement in its current location which is quite certain


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