From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/14739 Path: main.gmane.org!not-for-mail From: =?iso-8859-1?Q?Gilles_P=E9rez-Lambert?= Newsgroups: gmane.comp.tex.context Subject: Error with XML and JS Date: Tue, 17 Feb 2004 00:56:55 +0100 Sender: ntg-context-admin@ntg.nl Message-ID: <20040217005655084683.GyazMail.gilles.perez@univ-montp3.fr> Reply-To: ntg-context@ntg.nl NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 (GMessage framework 1.1.7) Content-Type: multipart/mixed; boundary=Multipart_20040217005654927407 X-Trace: sea.gmane.org 1076975912 24998 80.91.224.253 (16 Feb 2004 23:58:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 16 Feb 2004 23:58:32 +0000 (UTC) Original-X-From: ntg-context-admin@ntg.nl Tue Feb 17 00:58:23 2004 Return-path: Original-Received: from ref.vet.uu.nl ([131.211.172.13] helo=ref.ntg.nl) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Assd5-0006uD-00 for ; Tue, 17 Feb 2004 00:58:23 +0100 Original-Received: from ref.ntg.nl (localhost.localdomain [127.0.0.1]) by ref.ntg.nl (Postfix) with ESMTP id 5568610B13; Tue, 17 Feb 2004 00:56:37 +0100 (MET) Original-Received: from mail14.ha.ovh.net (b1.ovh.net [213.186.33.51]) by ref.ntg.nl (Postfix) with ESMTP id 186E510B09 for ; Tue, 17 Feb 2004 00:55:20 +0100 (MET) Original-Received: (qmail 18249 invoked by uid 503); 16 Feb 2004 23:57:22 -0000 Original-Received: from lns-p19-11-82-65-195-32.adsl.proxad.net (gpl%long-player.net@82.65.195.32) by ns0.ovh.net with DES-CBC3-SHA encrypted SMTP; 16 Feb 2004 23:57:22 -0000 Original-To: ntg-context@ntg.nl X-Mailer: GyazMail version 1.1.7 Errors-To: ntg-context-admin@ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.0.13 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.comp.tex.context:14739 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:14739 This is a multi-part message in MIME format. --Multipart_20040217005654927407 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello, Continuing the ConTeXt exploration with Hans's help: I'm trying to combine Hans's JS programming with XML processing but an error pops up: %%%%%%%%%%%%%%% javascript : loading script set fld (/Users/gpl/texmf/tex/context/base/java-fld.tex ! Missing \endcsname inserted. \unhbox \leavevmode ->\unhbox \voidb@x \fakeunderscore ->\leavevmode \hbox {\setbox \scratchbox \hbox {(}\scratchdi... \_...fmmode \mathunderscore \else \textunderscore \fi \XML:ent:tex-underscore ...tterunderscore \else \_ \fi \ascii ->Sanitized\getXMLentity {tex-underscore} TeX\getXMLentity {tex-unders... ... l.115 \stopJSpreamble %%%%%%%%%%%%%%% with the attached TeX file. There's some kind of interaction between the two modes. Without \start(stop)XMLdata, it works. Thanks for your time, Gilles, preparing the next demo of ConTeXt in June (Paris). :-) --Multipart_20040217005654927407 Content-Type: application/x-tex; x-unix-mode=0644; x-mac-creator=54655873; x-mac-type=54455854; name=xml-js.tex Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=xml-js.tex \startJSpreamble {Notes} used now var lastNote =3D "" ; function Show_Note ( Name ) { if (Name !=3D lastNote) { Hide_Note () ; var v =3D this.getField(Name) ; if (v) { console.println("Show Note: " + Name) ; v.display =3D display.visible ; v.readonly =3D false ; this.dirty =3D false ; lastNote =3D Name } } } function Hide_Note ( ) { if (lastNote !=3D "") { var v =3D this.getField(lastNote) ; if (v) { console.println("Hide Note: " + lastNote) ; v.display =3D display.hidden ; v.readonly =3D true ; this.dirty =3D false } } lastNote =3D "" } \stopJSpreamble \newcounter\AnotherNote \def\SomeNote#1#2% {\hbox {\doglobal\increment\AnotherNote \definesymbol[note:\AnotherNote:on][\WhatANote{#2}]% \setupfield[notes][offset=3Doverlay,frame=3Doff,option=3D{readonly,hi= dden}] % this confuses acrobat, probably some interference bug, I spent too mu= ch time on that % \setupfield[notes][offset=3Doverlay,frame=3Doff,option=3D{readonly,hi= dden},clickin=3DJS(Hide_Note)] \definefield[note:\AnotherNote][check][notes][note:\AnotherNote:on][n= ote:\AnotherNote:on]% \doifreferencefoundelse{note:\AnotherNote} {\setlayer[notes][page=3D\currentrealreference]{\fitfield[note:\Ano= therNote]}} {\setlayer[notes]{\fitfield[note:\AnotherNote]}}% \pagereference[note:\AnotherNote]\goto{#1}[JS(Show_Note{note:\Another= Note})]}} \setupinteraction [state=3Dstart, openpageaction=3DJS(Hide_Note), closepageaction=3DJS(Hide_Note)] \setupinteractionscreen [option=3Dmax] =20 \definereference[CloseNote][JS(Hide_Note)] \setupfootertexts[{\goto{Fermer la note}[CloseNote]}][] \setupcolors [state=3Dstart] \definecolor [notebackgroundcolor] [s=3D.85] \defineframedtext [WhatANote] [background=3Dcolor, backgroundcolor=3Dnotebackgroundcolor, width=3D.45\textwidth, height=3Dfit, align=3Dnormal, style=3D\ss, bodyfont=3D8pt] \definelayer [notes] [width=3D\paperwidth, height=3D\paperheight, preset=3Drightbottom, offset=3D1cm] \setupbackgrounds [page] [background=3Dnotes] \defineXMLenvironment[note] =09{} =09{\SomeNote{(\XMLop{id})}{\getbuffer[\XMLop{id}]}} \starttext \startbuffer[3] My note \stopbuffer \startXMLdata Try \stopXMLdata \stoptext=20 --Multipart_20040217005654927407--