From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/39543 Path: news.gmane.org!not-for-mail From: "Thomas A. Schmitz" Newsgroups: gmane.comp.tex.context Subject: Re: processing xml in mkiv Date: Sun, 16 Mar 2008 13:00:51 +0100 Message-ID: References: <332CF356-5BD2-469A-969E-7F2B3A61B7F4@uni-bonn.de> <20080316120425.bcb38147.schuster.wolfgang@googlemail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v919.2) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1205668956 636 80.91.229.12 (16 Mar 2008 12:02:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 16 Mar 2008 12:02:36 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Mar 16 13:03:05 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 1JarZw-0005y3-Ff for gctc-ntg-context-518@m.gmane.org; Sun, 16 Mar 2008 13:03:04 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 03EB81FC71; Sun, 16 Mar 2008 13:02:29 +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 14970-08-3; Sun, 16 Mar 2008 13:01:44 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 1E4F11FC21; Sun, 16 Mar 2008 13:01:44 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C18A51FC20 for ; Sun, 16 Mar 2008 13:01:42 +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 14970-08-2 for ; Sun, 16 Mar 2008 13:01:07 +0100 (CET) Original-Received: from mailout10.sul.t-online.com (mailout10.sul.t-online.de [194.25.134.21]) by ronja.ntg.nl (Postfix) with ESMTP id E9A2D1FC39 for ; Sun, 16 Mar 2008 13:01:06 +0100 (CET) Original-Received: from fwd25.aul.t-online.de by mailout10.sul.t-online.com with smtp id 1JarY2-0005pW-01; Sun, 16 Mar 2008 13:01:06 +0100 Original-Received: from [192.168.0.2] (r3-676ZfZhhJj9b0rNo8mmnEkJY0wi9yXgfhJDYLLloIiYa0rlw8nEY0EyPcpPaZmc@[87.178.117.33]) by fwd25.aul.t-online.de with esmtp id 1JarXn-1CtLqi0; Sun, 16 Mar 2008 13:00:51 +0100 In-Reply-To: <20080316120425.bcb38147.schuster.wolfgang@googlemail.com> X-Mailer: Apple Mail (2.919.2) X-ID: r3-676ZfZhhJj9b0rNo8mmnEkJY0wi9yXgfhJDYLLloIiYa0rlw8nEY0EyPcpPaZmc@t-dialin.net X-TOI-MSGID: 381f6c6e-d552-4005-8688-e4fc27b14291 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:39543 Archived-At: On Mar 16, 2008, at 12:04 PM, Wolfgang Schuster wrote: > On Sun, 16 Mar 2008 11:29:49 +0100 > "Thomas A. Schmitz" wrote: > >> Hi all, >> >> xml processing is about the last part of my ConTeXt stuff where I >> haven't been able to switch to mkiv; I just can't get my head around >> it... 2 questions: >> >> 1. When I try to process a xml-file with my old (mkii) environments, >> the output looks OK, but I always get a first page with the xml >> version declaration >> >> >> >> Is this a bug or a feature? Is there anything I can do to prevent it? > > Can you post a example, I never saw such a effect in my test files. Hi Wolfgang, OK, here is a minimal example: file test.xml: ]>

This is an xml file.

file testenvironment.tex \usemodule[xtag-ent] \defineXMLenvironment[document] {\starttext} {\stoptext} \defineXMLenvironment[section] {\section{\XMLpar{section}{title}{}}} {} \defineXMLenvironment[quotation] {\quotation\bgroup} {\egroup} When I process with mkii, I get the expected output. Processing with texexec --lua --env=testenvironment test.xml gives me the first line (here it's not an entire page) I described! > > >> 2. I'm really lost with the new xml mechanism. My first problem: In a >> message from September last year, Hans explained that the command to >> process xml files is: >> >>> The regular definitions still work but processing a file is done >>> differently: >>> >>> \xmlprocess{id}{filename}{optional initialization setup} >> >> I used to have environments with which to typeset a bunch of files. >> How can this be ported to the new mechanism, which appears to expect >> a filename? > > \xmlprocess{main}{filename.xml}{} works for me. I tried to translate this into the "new" mechanism and thought it should read like so: \startxmlsetups xml:mysetups \xmlsetsetup{\xmldocument}{text:p|section|quotation}{xml:*} \stopxmlsetups \xmlregistersetup{xml:mysetups} \startxmlsetups xml:p \xmlflush{#1}\endgraf \stopxmlsetups \startxmlsetups xml:quotation \quotation{\xmlflush{#1}} \stopxmlsetups \startxmlsetups xml:section \section{\xmlatt{#1}{section}{title}} \stopxmlsetups \starttext \xmlprocess{main}{test.xml}{} \stoptext But then, I only get "invalid xml file" in the output. > > >> Sorry if these are very basic problems, but I'm probably a bit obtuse >> here. > > You don't have to use new xml mechanism form MkIV, the old code could > be used without problems. The advantage of the new code is direct > access to elements in the tree (you could use xml files as database) > and the option to read from zip files. > > Wolfgang OK, I'll keep that in mind. Thanks for your help, Wolfgang! Thomas ___________________________________________________________________________________ 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 ___________________________________________________________________________________