From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/39544 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 13:51:06 +0100 Message-ID: <20080316135106.75223e86.schuster.wolfgang@googlemail.com> 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1205671963 8810 80.91.229.12 (16 Mar 2008 12:52:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 16 Mar 2008 12:52:43 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Sun Mar 16 13:53:08 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 1JasMK-0001dU-5o for gctc-ntg-context-518@m.gmane.org; Sun, 16 Mar 2008 13:53:04 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 13B341FB7F; Sun, 16 Mar 2008 13:52: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 16205-03-7; Sun, 16 Mar 2008 13:51:49 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 3CAE71FB8E; Sun, 16 Mar 2008 13:51:49 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 55CE71FB8E for ; Sun, 16 Mar 2008 13:51:47 +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 16995-01-7 for ; Sun, 16 Mar 2008 13:51:14 +0100 (CET) Original-Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by ronja.ntg.nl (Postfix) with ESMTP id 8B0221FADC for ; Sun, 16 Mar 2008 13:51:14 +0100 (CET) Original-Received: by fg-out-1718.google.com with SMTP id e12so4251997fga.8 for ; Sun, 16 Mar 2008 05:51:14 -0700 (PDT) Original-Received: by 10.82.187.2 with SMTP id k2mr573339buf.26.1205671874134; Sun, 16 Mar 2008 05:51:14 -0700 (PDT) Original-Received: from rover ( [91.41.121.182]) by mx.google.com with ESMTPS id e20sm19666652fga.1.2008.03.16.05.51.12 (version=SSLv3 cipher=OTHER); Sun, 16 Mar 2008 05:51:13 -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:39544 Archived-At: > 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! 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. > >> 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 \startxmlsetups xml:section \section{\xmlatt{#1}{section}{title}} \xmlflush{#1} \stopxmlsetups > \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 but the next one ]> give only "invalid xml file". 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 ___________________________________________________________________________________