> > How does ConTeXt handle CDATA sections in XML?
> 
> Incorrectly :). I'd post a fix later today.
> 
> Meanwhile, this works OK:

Oops, it didn't. :(

Here is a fix for Context that makes sure it behaves ok wrt.
CDATA sections. Should be included somewhere on top of the document
or in cont-usr.tex (until it makes it into the distribution)


% start of patch
\let\doxparseXMLescape\xparseXMLescape
\def\xparseXMLescape!#1%
   {\if[#1%
       \expandafter\expandafter\expandafter\doCDATAsection
    \else \if-#1%
       \expandafter\expandafter\expandafter\doCOMMENT
    \else
       \expandafter\expandafter\expandafter\doparseXMLescape 
    \fi\fi !#1}

\def\doCDATAsection![#1[%
  {\skipfirstverbatimlinefalse
   \processtaggeddisplayverbatim{]]>}}

\def\doCOMMENT {\gobbleuntil{-->}}
% end of patch

Reply via email to