[NTG-context] XML and ConTeXt - no XML text showing up in output

Steve Anderson steveo at member.fsf.org
Fri Dec 27 01:15:13 CET 2013


I'm following the instructions in
http://pragma-ade.com/general/manuals/xml-mkiv.pdf for using XML in
ConTeXt.

When I run the first example, I get a PDF, but only the hard-coded text
string "Contents" is in the PDF; none of the strings from the XML file are
in the PDF.

Any ideas?

    - Steve

Mac OSX 10.7.5, MacTEX-2013

I've created the following two files:

==================
demo.xml
==================
<?xml version='1.0' standalone='yes?>
<!-- From http://pragma-ade.com/general/manuals/xml-mkiv.pdf -->
<document>
<section>
<title>Some title</title>
<content>
<p>a paragraph of text</p>
<p>another paragraph of text</p>
</content>
</section>
</document>

==================
demo-converter.tex
==================
\startxmlsetups xml:demo:base
  \xmlsetsetup{demo}{*}{-}
  \xmlsetsetup{demo}{document|section|p}{xml:demo:*}
\stopxmlsetups
\xmlregisterdocumentsetup{demo}{xml:demo:base}
\startxmlsetups xml:demo:document
  \title{Contents}
  \placelist[chapter]
  \page
  \xmlflush{#1}
\stopxmlsetups
\startxmlsetups xml:demo:section
  \chapter{\xmlfirst{#1}{/title}}
  \xmlfirst{#1}{/content}
\stopxmlsetups
\startxmlsetups xml:demo:p
  \xmlflush{#1}\endgraf
\stopxmlsetups
\xmlprocessfile{demo}{demo.xml}{}
==================

and the command I'm running is

  context demo-converter.tex

Standard out is:

==================

ConTeXt  ver: 2013.04.20 01:15 MKIV current  fmt: 2013.12.26  int:
english/english

system          > 'cont-new.mkiv' loaded
(/usr/local/texlive/2013/texmf-dist/tex/context/base/cont-new.mkiv)
system          > files > jobname 'demo-converter', input
'./demo-converter', result 'demo-converter'
fonts           > latin modern fonts are not preloaded
languages       > language 'en' is active
(/Users/sanderson/dev/doc/main/feature/texml/content/demo-converter.tex
structure       > sectioning > title @ level 2 : 0.0 -> Contents
fonts           > beware: no fonts are loaded yet, using 'lm mono' in box
backend         > xmp > using file
'/usr/local/texlive/2013/texmf-dist/tex/context/base/lpdf-pdx.xml'
pages           > flushing realpage 1, userpage 1
structure       > sectioning > chapter @ level 2 : 0.1 -> \xmlfirst
{demo::5}{/title}
)
system          > invalid \starttext ... \stoptext structure
pages           > flushing realpage 2, userpage 2
 )</usr/local/texlive/2013/texmf-dist/fonts/opentype/public/lm/lmmono10-regular.otf>

mkiv lua stats  > used config file:
selfautoparent:/texmfcnf.lua;selfautoparent:/texmf-dist/web2c/texmfcnf.lua
mkiv lua stats  > used cache path: readable:
'/usr/local/texlive/2013/texmf-var/luatex-cache/context/a86c089b384a3076dc514ba966a1fac9'
| readable+writable:
'/Users/sanderson/Library/texlive/2013/texmf-var/luatex-cache/context/a86c089b384a3076dc514ba966a1fac9'
mkiv lua stats  > resource resolver: loadtime 0.415 seconds, 0 scans with
scantime 0.000 seconds, 0 shared scans, 7 found files, scanned paths: <none>
mkiv lua stats  > stored bytecode data: 326 modules (0.207 sec), 69 tables
(0.003 sec), 395 chunks (0.210 sec)
mkiv lua stats  > cleaned up reserved nodes: 41 nodes, 9 lists of 441
mkiv lua stats  > node memory usage: 2 glue, 3 penalty, 12 attribute, 36
glue_spec, 3 attribute_list
mkiv lua stats  > node list callback tasks: 6 unique task lists, 5
instances (re)created, 103 calls
mkiv lua stats  > used backend: pdf (backend for directly generating pdf
output)
mkiv lua stats  > loaded patterns: en::2
mkiv lua stats  > jobdata time: 0.005 seconds saving, 0.001 seconds loading
mkiv lua stats  > callbacks: 290 direct, 197 indirect, 487 total
mkiv lua stats  > randomizer: resumed with value 0.88342237327407
mkiv lua stats  > xml load time: 0.002 seconds, 1 files, 1 converted
mkiv lua stats  > lxml preparation time: 0.000 seconds, 9 nodes, 20 lpath
calls, 1 cached calls
mkiv lua stats  > result saved in file: demo-converter.pdf, compresslevel
3, objectcompreslevel 3
mkiv lua stats  > loaded fonts: 1 files: lmmono10-regular.otf
mkiv lua stats  > fonts load time: 0.042 seconds
mkiv lua stats  > luatex banner: this is luatex, version
beta-0.76.0-2013052718  (tex live 2013) (rev 4627)
mkiv lua stats  > control sequences: 35558 of 65536 + 100000
mkiv lua stats  > current memory usage: 47 MB (ctx: 47 MB)
mkiv lua stats  > runtime: 0.676 seconds, 2 processed pages, 2 shipped
pages, 2.959 pages/second

system          | total runtime: 1.382

==================
and here's the log file
==================

(/usr/local/texlive/2013/texmf-dist/tex/context/base/cont-yes.mkiv

ConTeXt  ver: 2013.04.20 01:15 MKIV current  fmt: 2013.12.26  int:
english/english

system          > 'cont-new.mkiv' loaded
(/usr/local/texlive/2013/texmf-dist/tex/context/base/cont-new.mkiv)
system          > files > jobname 'demo-converter', input
'./demo-converter', result 'demo-converter'
fonts           > latin modern fonts are not preloaded
languages       > language 'en' is active
(/Users/sanderson/dev/doc/main/feature/texml/content/demo-converter.tex
structure       > sectioning > title @ level 2 : 0.0 -> Contents
fonts           > beware: no fonts are loaded yet, using 'lm mono' in box
backend         > xmp > using file
'/usr/local/texlive/2013/texmf-dist/tex/context/base/lpdf-pdx.xml'
pages           > flushing realpage 1, userpage 1
structure       > sectioning > chapter @ level 2 : 0.1 -> \xmlfirst
{demo::5}{/title}
)
system          > invalid \starttext ... \stoptext structure
pages           > flushing realpage 2, userpage 2
 )</usr/local/texlive/2013/texmf-dist/fonts/opentype/public/lm/lmmono10-regular.otf>

system          > files > start used files

used files      >    1: filename=cont-yes.mkiv filetype=tex
foundname=/usr/local/texlive/2013/texmf-dist/tex/context/base/cont-yes.mkiv
usedmethod=database
used files      >    2: filename=cont-new.mkiv filetype=tex
foundname=/usr/local/texlive/2013/texmf-dist/tex/context/base/cont-new.mkiv
usedmethod=database
used files      >    3: filename=lang-us.lua filetype=lua
foundname=/usr/local/texlive/2013/texmf-dist/tex/context/patterns/lang-us.lua
usedmethod=database
used files      >    4:
filename=/Users/sanderson/dev/doc/main/feature/texml/content/demo-converter.tex
foundname=/Users/sanderson/dev/doc/main/feature/texml/content/demo-converter.tex
usedmethod=direct
used files      >    5: filename=demo.xml foundname=demo.xml
usedmethod=direct
used files      >    6: filename=lmmono10-regular filetype=otf format=otf
foundname=/usr/local/texlive/2013/texmf-dist/fonts/opentype/public/lm/lmmono10-regular.otf
usedmethod=database
used files      >    7: filename=lpdf-pdx.xml filetype=tex
foundname=/usr/local/texlive/2013/texmf-dist/tex/context/base/lpdf-pdx.xml
usedmethod=database

system          > files > stop used files


system          > structure > start used structure

used structure  > text: demo-converter

system          > structure > stop used structure


system          > files > start used files

used file       >    1: filename=cont-yes.mkiv filetype=tex
foundname=/usr/local/texlive/2013/texmf-dist/tex/context/base/cont-yes.mkiv
usedmethod=database
used file       >    2: filename=cont-new.mkiv filetype=tex
foundname=/usr/local/texlive/2013/texmf-dist/tex/context/base/cont-new.mkiv
usedmethod=database
used file       >    3: filename=lang-us.lua filetype=lua
foundname=/usr/local/texlive/2013/texmf-dist/tex/context/patterns/lang-us.lua
usedmethod=database
used file       >    4:
filename=/Users/sanderson/dev/doc/main/feature/texml/content/demo-converter.tex
foundname=/Users/sanderson/dev/doc/main/feature/texml/content/demo-converter.tex
usedmethod=direct
used file       >    5: filename=demo.xml foundname=demo.xml
usedmethod=direct
used file       >    6: filename=lmmono10-regular filetype=otf format=otf
foundname=/usr/local/texlive/2013/texmf-dist/fonts/opentype/public/lm/lmmono10-regular.otf
usedmethod=database
used file       >    7: filename=lpdf-pdx.xml filetype=tex
foundname=/usr/local/texlive/2013/texmf-dist/tex/context/base/lpdf-pdx.xml
usedmethod=database

system          > files > stop used files


system          > options > start commandline options

used option     > currentrun="1"
used option     > fulljobname="./demo-converter.tex"
used option     > input="./demo-converter.tex"
used option     > kindofrun="1"
used option     > maxnofruns="8"
used option     > no-parse-first-line="true"

system          > options > stop commandline options

system          > options > start commandline files

used file       >    1: ./demo-converter.tex

system          > options > stop commandline files



mkiv lua stats  > used config file:
selfautoparent:/texmfcnf.lua;selfautoparent:/texmf-dist/web2c/texmfcnf.lua
mkiv lua stats  > used cache path: readable:
'/usr/local/texlive/2013/texmf-var/luatex-cache/context/a86c089b384a3076dc514ba966a1fac9'
| readable+writable:
'/Users/sanderson/Library/texlive/2013/texmf-var/luatex-cache/context/a86c089b384a3076dc514ba966a1fac9'
mkiv lua stats  > resource resolver: loadtime 0.415 seconds, 0 scans with
scantime 0.000 seconds, 0 shared scans, 7 found files, scanned paths: <none>
mkiv lua stats  > stored bytecode data: 326 modules (0.207 sec), 69 tables
(0.003 sec), 395 chunks (0.210 sec)
mkiv lua stats  > cleaned up reserved nodes: 41 nodes, 9 lists of 441
mkiv lua stats  > node memory usage: 2 glue, 3 penalty, 12 attribute, 36
glue_spec, 3 attribute_list
mkiv lua stats  > node list callback tasks: 6 unique task lists, 5
instances (re)created, 103 calls
mkiv lua stats  > used backend: pdf (backend for directly generating pdf
output)
mkiv lua stats  > loaded patterns: en::2
mkiv lua stats  > jobdata time: 0.005 seconds saving, 0.001 seconds loading
mkiv lua stats  > callbacks: 290 direct, 197 indirect, 487 total
mkiv lua stats  > randomizer: resumed with value 0.88342237327407
mkiv lua stats  > xml load time: 0.002 seconds, 1 files, 1 converted
mkiv lua stats  > lxml preparation time: 0.000 seconds, 9 nodes, 20 lpath
calls, 1 cached calls
mkiv lua stats  > result saved in file: demo-converter.pdf, compresslevel
3, objectcompreslevel 3
mkiv lua stats  > loaded fonts: 1 files: lmmono10-regular.otf
mkiv lua stats  > fonts load time: 0.042 seconds
mkiv lua stats  > luatex banner: this is luatex, version
beta-0.76.0-2013052718  (tex live 2013) (rev 4627)
mkiv lua stats  > control sequences: 35558 of 65536 + 100000
mkiv lua stats  > current memory usage: 47 MB (ctx: 47 MB)
mkiv lua stats  > runtime: 0.676 seconds, 2 processed pages, 2 shipped
pages, 2.959 pages/second

-- 
steveo at member.fsf.org
What you say does matter, and so does how you say it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ntg.nl/pipermail/ntg-context/attachments/20131226/346f308a/attachment-0001.html>


More information about the ntg-context mailing list