From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/39546 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: processing xml in mkiv Date: Sun, 16 Mar 2008 14:56:26 +0100 Message-ID: <20080316145626.4f379df1.schuster.wolfgang@googlemail.com> References: <332CF356-5BD2-469A-969E-7F2B3A61B7F4@uni-bonn.de> <20080316120425.bcb38147.schuster.wolfgang@googlemail.com> <20080316135106.75223e86.schuster.wolfgang@googlemail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1205675925 19666 80.91.229.12 (16 Mar 2008 13:58:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 16 Mar 2008 13:58:45 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Sun Mar 16 14:59:13 2008 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1JatOJ-0002MS-Gj for gctc-ntg-context-518@m.gmane.org; Sun, 16 Mar 2008 14:59:11 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id ACD5F1FC03; Sun, 16 Mar 2008 14:58:26 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 20842-01-10; Sun, 16 Mar 2008 14:57:42 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 78FBC1FBBE; Sun, 16 Mar 2008 14:57:42 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 9F51E1FBBE for ; Sun, 16 Mar 2008 14:57:40 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 21094-01-7 for ; Sun, 16 Mar 2008 14:57:02 +0100 (CET) Original-Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157]) by ronja.ntg.nl (Postfix) with ESMTP id AD5E11FBC6 for ; Sun, 16 Mar 2008 14:57:02 +0100 (CET) Original-Received: by fg-out-1718.google.com with SMTP id e12so4273938fga.8 for ; Sun, 16 Mar 2008 06:57:02 -0700 (PDT) Original-Received: by 10.82.150.20 with SMTP id x20mr33317824bud.16.1205675822107; Sun, 16 Mar 2008 06:57:02 -0700 (PDT) Original-Received: from rover ( [91.41.121.182]) by mx.google.com with ESMTPS id p9sm24395191fkb.14.2008.03.16.06.57.00 (version=SSLv3 cipher=OTHER); Sun, 16 Mar 2008 06:57:01 -0700 (PDT) In-Reply-To: X-Mailer: Sylpheed 2.5.0beta1 (GTK+ 2.10.14; i686-pc-mingw32) X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:39546 Archived-At: > > This seems like a bug to me. This did only happen with the content in > > the first line because I inserted a empty first line at the begin of > > the line the xml header disappeared from the pdf, could be related to > > a wrong catcode for the "<" at the beginning of the line. > > > > OK, then this is a bug. The declaration has to be on the first line, > my editor (emacs in nxml mode) doesn't even let me save the file when > I introduce a first blank line before it. No problems with Scite or EmEditor. > >>>> \xmlprocess{main}{filename.xml}{} works for me. > > Yes, but that would mean you need an environment for every xml file > you want to process. I have now tried > \xmlprocess{main}{\inputfilename}{} > > and this seems to work. > > >> \startxmlsetups xml:section > >> \section{\xmlatt{#1}{section}{title}} > >> \stopxmlsetups > > > > \startxmlsetups xml:section > > \section{\xmlatt{#1}{section}{title}} > > \xmlflush{#1} > > \stopxmlsetups > > Thanks! I experimented a bit more; I think it has to be > > \startxmlsetups xml:section > \section{\xmlatt{#1}{title}} > \xmlflush{#1} > \stopxmlsetups > > (at least, this seems to work for me...) I did the same thing in my example but forgot it in my last mail. > >> \starttext > >> \xmlprocess{main}{test.xml}{} > >> \stoptext > >> > >> But then, I only get "invalid xml file" in the output. > > > > Remove the DOCDATA definition from your xml file, seems the parser has > > problems with "<>" pairs inside of the DOCDATA definition. > > > > The following line give me a pdf file > > > > > > ]> > > Hmm, but this isn't valid xml? I know but it could help to find the wrong definition in the xml parser. > > but the next one > > > > > > > ]> > > Whereas this is valid and processed without problems by mkii? You should know, MkII read the xml code with TeX macros whereas MkIV use lpeg to read the xml code. > Hmm, either mkiv xml handling is still a bit immature, or I'm not > mature enough to use it yet :-) The MkIV is new and still under development, tests like your one help to find errors and to fix them. Wolfgang ___________________________________________________________________________________ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________