[NTG-context] XML-lookahead

Hans Hagen pragma at wxs.nl
Sun Aug 27 14:56:12 CEST 2006


Sjoerd Siebinga wrote:
> Hi all,
>
> Is it possible to use something like \doifnextcharelse for xml- 
> environments or is there a clever work-around? I need to know what  
> the next tag is in order to decide if a linebreak needs to be inserted.
>   
there is a way to build a stack and look onto it but that's of no use here
> For example:
>
> \defineXMLenvironment [av] {} {} % linebreak unless followed by  
> <liste>-tag
> \defineXMLenvironment [liste] {} {\crlf} % always a linebreak
>
>
> \startXMLdata
>
> <av> text </av> <liste> 15 </liste>  <!-- \crlf -->
>
>
> <av> text </av>  <!-- \crlf -->
>
> \stopXMLdata
>   
maybe look back: 

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



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