From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/41374 Path: news.gmane.org!not-for-mail From: "Wolfgang Schuster" Newsgroups: gmane.comp.tex.context Subject: xml question Date: Fri, 6 Jun 2008 10:19:34 +0200 Message-ID: <115224fb0806060119h6407c9f6nee180fd469a59d77@mail.gmail.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 1212740451 6919 80.91.229.12 (6 Jun 2008 08:20:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Jun 2008 08:20:51 +0000 (UTC) To: "mailing list for ConTeXt users" Original-X-From: ntg-context-bounces@ntg.nl Fri Jun 06 10:21:30 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 1K4XCT-0007x2-CF for gctc-ntg-context-518@m.gmane.org; Fri, 06 Jun 2008 10:21:29 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 4609B1FDEE; Fri, 6 Jun 2008 10:20:36 +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 21577-03-4; Fri, 6 Jun 2008 10:20:19 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 5DDFE1FC74; Fri, 6 Jun 2008 10:20:19 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 675531FC72 for ; Fri, 6 Jun 2008 10:20:14 +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 21682-01-8 for ; Fri, 6 Jun 2008 10:19:37 +0200 (CEST) Original-Received: from ag-out-0708.google.com (ag-out-0708.google.com [72.14.246.249]) by ronja.ntg.nl (Postfix) with ESMTP id D07E91FC74 for ; Fri, 6 Jun 2008 10:19:35 +0200 (CEST) Original-Received: by ag-out-0708.google.com with SMTP id 35so3006684aga.1 for ; Fri, 06 Jun 2008 01:19:34 -0700 (PDT) Original-Received: by 10.150.58.5 with SMTP id g5mr3033680yba.35.1212740374855; Fri, 06 Jun 2008 01:19:34 -0700 (PDT) Original-Received: by 10.151.113.9 with HTTP; Fri, 6 Jun 2008 01:19:34 -0700 (PDT) Content-Disposition: inline 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:41374 Archived-At: Hi, I played with a little bit with the docbook syntax and came to a problem with headers. The text for chapter headers is written between the title elements, to get the text I use the \xmlfirst command but this did not prevent the text in the element to appear again in the normal document text. As a workaround I introduced the \ifheading to flush the content only in chapter headers, is there a better way to do this? It is also possible to place the title elements outside of the chapter group where it is used as a header by itself, I did this now by another test \ifchapter where I test if it called within a chapter or not but a better solution is welcome. My last question is what I the preferef method to define entities in MkIV, \defineXMLentity is a MkII command and did not fit in the MkIV xmlsetup commands. \startbuffer[test] Document with &ConTeXt; The first Chapter Normal Text. Normal Text. Another Chapter Normal Text. Normal Text. \stopbuffer \unprotect \startxmlsetups setup \xmlsetsetup{\xmldocument}{title}{*} \xmlsetsetup{\xmldocument}{chapter}{*} \xmlsetsetup{\xmldocument}{para}{*} \stopxmlsetups \xmlregistersetup{setup} \newif\ifheading \newif\ifchapter \startxmlsetups title \ifchapter \ifheading\xmlflush{#1}\fi \else \title{\xmlflush{#1}} \fi \stopxmlsetups \startxmlsetups chapter \headingtrue \chaptertrue \chapter[\xmlatt{#1}{id}]{\xmlfirst{#1}{title}} \headingfalse \xmlflush{#1} \chapterfalse \stopxmlsetups \startxmlsetups para \xmlflush{#1}\par \stopxmlsetups \defineXMLentity [ConTeXt] \ConTeXt \protect \starttext \xmlprocessbuffer{main}{test}{} \stoptext 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 ___________________________________________________________________________________