From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/41339 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: xml in mkiv Date: Tue, 03 Jun 2008 20:13:54 +0200 Message-ID: <484589E2.4080602@wxs.nl> 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 1212516977 26982 80.91.229.12 (3 Jun 2008 18:16:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 3 Jun 2008 18:16:17 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Jun 03 20:16:58 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 1K3b46-0001wm-7e for gctc-ntg-context-518@m.gmane.org; Tue, 03 Jun 2008 20:16:58 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 3E98A1FD6D; Tue, 3 Jun 2008 20:16:06 +0200 (CEST) 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 04572-04-3; Tue, 3 Jun 2008 20:15:15 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 7BC6E1FD8A; Tue, 3 Jun 2008 20:15:15 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C93081FD48 for ; Tue, 3 Jun 2008 20:14:35 +0200 (CEST) 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 02940-01-11 for ; Tue, 3 Jun 2008 20:13:58 +0200 (CEST) Original-Received: from mail.pragma-ade.net (dsl-083-247-100-017.solcon.nl [83.247.100.17]) by ronja.ntg.nl (Postfix) with ESMTP id A88351FD59 for ; Tue, 3 Jun 2008 20:13:54 +0200 (CEST) Original-Received: from [10.100.1.100] (unverified [10.100.1.100]) by controller-1 (SurgeMail 3.9e) with ESMTP id 10350-1840426 for ; Tue, 03 Jun 2008 20:13:54 +0200 User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) X-Originating-IP: 10.100.1.100 X-Authenticated-User: hagen@controller-1 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:41339 Archived-At: Hi, [if you never use xml or don't use mkiv, you can skip this message] Currently in mkiv, the mkii method of xml is active at the same time; however, this is not always what you want and eventually i suppose that mkiv xml usage will replace mkii usage (i'm thinking of at some point making the old stream based xml method a module for mkiv) anyhow, one of aspects we need to deal with is mixed usage of documents, more about that later the latest beta has a \setupxml command with the following options (there are a few more): \setupxml[\c!method=mkii] % mixed mkiv and mkii \setupxml[\c!method=mkiv,\c!default=] % mkiv only \setupxml[\c!method=mkiv,\c!default=\v!none] % mkiv only, undefined -> hidden \setupxml[\c!method=mkiv,\c!default=\v!text] % mkiv only, undefined -> text the tricky part is in dealing with entities. By default entities are resolved to utd code, which means that <, > and & are part if the normal text stream. This is tricky because in mkii a dangling < or & gives an error. However, in mkii mode (i.e. mixed mode), these three characters are remapped to some place safe (the location in the unicode table will change once we have active chars in the private planes). i used this test: % \defineXMLenvironment[y]{(}{)} % % \startxmlsetups x % /\xmlflush{#1}/ % \stopxmlsetups % % \startxmlsetups xx % \xmlsetsetup{main}{x}{*} % \stopxmlsetups % % \xmlregistersetup{xx} % % \startbuffer % a <&>{b} c % \stopbuffer Another change is that 'context --env=bla whatever.xml' will use mkiv xml mode unless the --mkii flag is passed. The alternative is rather ugly and tricky overloading of the traditional XML macros, an option that i rejected. An example that demonstrates mkiv usage is: context --ctx=x-ldx l-dimen.lua this will produce the documentation of l-dimen.lua and does a transformation as defined in the ctx file. Eventually all those texexec goodies (--pdfwhatever) will become such scripts combined with styles. Much is experimental and I will add more control over specific documents. Take for instance (from x-ldx.tex): \usemodule[mathml] \xmlregisterdocumentsetup{ldx}{xml:mml:define} \xmlregisterdocumentsetup{ldx}{xml:ldx:define} \xmlregisterns{ldx}{ldx} \startxmlsetups xml:ldx:define \xmlgrab {\xmldocument} {ldx:*} {*} \stopxmlsetups This associates the ldx definitions to the document but also mathml. I'm converting all traditional xml handling used in the core into mkiv handling (e.g. clt handling is already converted; clt deals with remapping filesnames into the ones that come out of preprocessing, as for instance in the ldx module). Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________