Graham Douglas wrote:

One question, in the minimal example below, the XML text:

text = '<elem1>    text     <elem2/>     more text </elem1>'

parses fine *if* on a single line. If I break the text onto multiple lines, eg

text = '<elem1>    text     <elem2/>
     more text </elem1>'

it fails with

! LuaTeX error <main ctx instance>:3: unfinished string near ''<elem1> text <elem2/>'.
} = lxp.new(callbacks)d

\dodostartluacode ...d \directlua \zerocount {#1}}

l.21 \stopluacode


Why is this --- is this a catcode issue?

No, not at all. Lua supports only single-line '' or "" strings.

Can you suggest a fix?

Multi-line strings in Lua use square brackets

text = [[<elem1>    text     <elem2/>
         more text </elem1>]]

See http://www.lua.org/manual/5.1/manual.html#2.1 for details.

Best wishes,
Taco
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to