From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/7134 Path: main.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: CDATA/XML Date: Wed, 06 Mar 2002 11:50:05 +0100 Sender: owner-ntg-context@let.uu.nl Message-ID: <5.1.0.14.1.20020306114819.03504008@server-1> References: <20020306091901.7f998665.taco@elvenkind.com> <20020305193014.GA4953@miwie.in-berlin.de> <20020306091901.7f998665.taco@elvenkind.com> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Trace: main.gmane.org 1035397619 16719 80.91.224.250 (23 Oct 2002 18:26:59 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 18:26:59 +0000 (UTC) Cc: mw@miwie.in-berlin.de, ntg-context@ntg.nl Original-To: Taco Hoekwater In-Reply-To: <20020306104552.148a7bc2.taco@elvenkind.com> Xref: main.gmane.org gmane.comp.tex.context:7134 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:7134 At 10:45 AM 3/6/2002 +0100, Taco Hoekwater wrote: > > > 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 In the beta the patch is: in xtag-ini: grab #1 from ]...] \long\def\xparseXMLescape !#1#2% {\if#1-% \if#2-% \expandafter\expandafter\expandafter\xxparseXMLescape \else \expandafter\expandafter\expandafter\xyparseXMLescape \fi \else \if#1[% \expandafter\expandafter\expandafter\xzparseXMLescape \else \expandafter\expandafter\expandafter\xyparseXMLescape \fi \fi#1#2} \long\def\xzparseXMLescape[#1[{\parseXMLescape{#1}} in xtag-pre: {CDATA]} => CDATA \defineXMLescape [CDATA] {\skipfirstverbatimlinefalse \processtaggeddisplayverbatim{]]>}} So, this way we keep the installable parser in place 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 ------------------------------------------------------------------------- fall-back web server: www.pragma-ade.nl -------------------------------------------------------------------------