From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/84904 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: How to debug XML processing Date: Sun, 20 Oct 2013 07:05:36 +0900 Message-ID: <52630230.8000004@wxs.nl> References: <33536258.250373553.1382102560348.JavaMail.root@zimbra71-e12.priv.proxad.net> <52627E15.8030400@uni-bonn.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1382220344 14176 80.91.229.3 (19 Oct 2013 22:05:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 19 Oct 2013 22:05:44 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Sun Oct 20 00:05:50 2013 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VXeeZ-0004Hb-WE for gctc-ntg-context-518@m.gmane.org; Sun, 20 Oct 2013 00:05:48 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 26596101EC; Sun, 20 Oct 2013 00:02:57 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id PL3vuP+lHuNI; Sun, 20 Oct 2013 00:02:55 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 45865101E7; Sun, 20 Oct 2013 00:02:55 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id EC104101E7 for ; Sun, 20 Oct 2013 00:02:53 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id YaRv-zWRPQ8c for ; Sun, 20 Oct 2013 00:02:52 +0200 (CEST) Original-Received: from filter3-til.mf.surf.net (filter3-til.mf.surf.net [194.171.167.219]) by balder.ntg.nl (Postfix) with ESMTP id D489D101E6 for ; Sun, 20 Oct 2013 00:02:52 +0200 (CEST) Original-Received: from smtp.ziggozakelijk.nl (D57D1DA2.static.ziggozakelijk.nl [213.125.29.162]) by filter3-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r9JM5fOs001008 for ; Sun, 20 Oct 2013 00:05:41 +0200 X-Default-Received-SPF: pass (skip=loggedin (res=PASS)) x-ip-name=10.0.4.6; Original-Received: from [10.0.4.6] (unverified [10.0.4.6]) by pragma-net.nl (SurgeMail 6.3c2) with ESMTP id 10984-1713362 for ; Sun, 20 Oct 2013 00:05:40 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 In-Reply-To: <52627E15.8030400@uni-bonn.de> X-Authenticated-User: hagen@controller-9 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=213.125.29.162; country=NL; region=15; city=Zwolle; latitude=52.5058; longitude=6.0858; http://maps.google.com/maps?q=52.5058,6.0858&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 06KDa5Fe1 - 01dc7a93b0da - 20131020 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.219 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:84904 Archived-At: On 10/19/2013 9:41 PM, Thomas A. Schmitz wrote: > On 10/18/2013 03:22 PM, stephleg@free.fr wrote: >> Hello, >> >> After reading "Getting Web Content and pdf-Output from One Source" by >> Thomas A. Schmitz, i'm trying to use the same method to build a PDF >> file from a HTML one. But i quickly found that when something doesn't >> work as expected, it's pretty hard to debug because it's hard to tell >> if the error come from the environment file, the lua code or >> something else. >> >> So are there some useful tricks to debug this kind of processing >> besides the \enabletrackers command? Especially is there a way to >> view the generated ConTeXt code after the macro expansion? >> >> Thank you. > > Let me put it this way: if there is a way, I don't know about it. You're > right that debugging becomes more complex because there are more layers > of complexity involved. OTOH: many editors can validate xml as you type > (I don't know of any that does the same for TeX input), so at least you > know when your source should compile. And one tip (something I have > started too late): put your lua code in a separate file and call it from > within your TeX environment, that way, context's error messages become > more precise. in most cases the filtering is is straightforward: \xmlflush, xmlfirst, xmlall + a simple path into the tree (relative to the current node) it becomes more complex if data has to come from other places (combining xml nodes) but once you need that, you probably know what you're dealing with anyway concerning tracing: there are some trackers (lxml.*) that show the results of filtering, and if you want to see what goes in deep down you can try \enabletrackers[context*] but this also shows data generated and passes by other mechamisms. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________