Starting the typesetting in mkiv of xml data I cannot get a simple example working. I studied both the recent MyWay document and Hans Hagens xml-mkiv reference manual (especially page 11). From these I concocted the following simple test: file typeset from TeXShop is dvd-setup.tex containing: \startxmlsetups xml:dvdsetups \xmlsetsetup{dvdsetups}{*}{-} \xmlsetsetup{dvdsetups}{dvd|title|subtitle}{xml:*} \stopxmlsetups \xmlregistersetup{xml:dvdsetups} % also not working: {dvdsetups} \startxmlsetups xml:dvd \Filenumber{\xmlatt{#1}{filenumber}} \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:title \Title{\xmlflush{#1}} \stopxmlsetups \startxmlsetups xml:subtitle \Subtitle{\xmlflush{#1}} \stopxmlsetups \def\Filenumber#1{Filenumber = \quotation{#1}\crlf} \def\Title#1{Title = \quotation{#1}\crlf} \def\Subtitle#1{Subtitle = \quotation{#1}\crlf} \starttext \xmlprocessfile{dvd}{dvd.xml}{} \stoptext \endinput The file dvd.tex contains the following data: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <dvd filenumber="D001"> <title>Title</title> <subtitle>subtitle</subtitle> </dvd> The result is a single ouput line with on it: Title subtitle That is just the data inside the dvd nodes. What am I doing wrong here? version recently loaded:ConTeXt ver: 2010.03.02 12:34 MKIV fmt: 2010.3.8 int: english/english Hans van der Meer
On 8-3-2010 21:53, Hans van der Meer wrote:
Starting the typesetting in mkiv of xml data I cannot get a simple example working. I studied both the recent MyWay document and Hans Hagens xml-mkiv reference manual (especially page 11). From these I concocted the following simple test:
file typeset from TeXShop is dvd-setup.tex containing: \startxmlsetups xml:dvdsetups \xmlsetsetup{dvdsetups}{*}{-} \xmlsetsetup{dvdsetups}{dvd|title|subtitle}{xml:*} \stopxmlsetups
\xmlsetsetup{#1}{dvd|title|subtitle}{xml:*} (or dvd as that's what you use later) consider the #1 to be a sort of symbolic reference to the current node, in this case being the root of the document (which in your case is dvd) we can have many docs in memory either or not accessed explicitly 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 -----------------------------------------------------------------
participants (2)
-
Hans Hagen
-
Hans van der Meer