Wolfgang Schuster wrote:
On Thu, May 1, 2008 at 11:00 AM, Thomas A. Schmitz
wrote: On Apr 30, 2008, at 6:10 PM, Hans Hagen wrote:
Wolfgang Schuster wrote:
The DTD is a problem with the ConTeXts XML parser and has nothing to do with LuaTeX (hope this is right).
i need a test file then (can look into it next week; i'm at bachotek now)
OK, I hope this is a minimal test: I have this xml file (which, I think, is valid xml):
\startbuffer[test]
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE context [ <!ELEMENT document (section)> <!ELEMENT section (title,content)> <!ELEMENT title (#PCDATA)> <!ELEMENT content (#PCDATA)> <!ENTITY ndash "–"> ]>
<document> <section> <title>The Title</title> <content> <p>A line of text – with a dash.</p> </content> </section> </document> \stopbuffer
and this environment myenv.tex:
\startxmlsetups xml:mysetups \xmlsetsetup{\xmldocument}{document|section|}{xml:*} \stopxmlsetups
\xmlregistersetup{xml:mysetups}
\startxmlsetups xml:document \xmlflush{#1} \stopxmlsetups
\startxmlsetups xml:section \section{\xmlfirst{#1}{title}} \xmlfirst{#1}{content}\par \stopxmlsetups
\enableregime[utf]
\defineXMLentity[ndash]{--}
\starttext \xmlprocess{main}{\inputfilename}{} \xmlprocessbuffer{main}{est}{} \stoptext
Easier for test because you need only one file.
or just (for testing) mtxrun --script blabla.lua : str = [[ <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE context [ <!ELEMENT document (section)> <!ELEMENT section (title,content)> <!ELEMENT title (#PCDATA)> <!ELEMENT content (#PCDATA)> <!ENTITY ndash "–"> ]> <document> <section> <title>The Title</title> <content> <p>A line of text – with a dash.</p> </content> </section> </document> ]] x = xml.convert(str) xml.merge_entities(x) xml.resolve_entities(x) print(table.serialize(x)) i fixed the bug but no upload yet; also, i'm still not sure about merging entities defined in the document ----------------------------------------------------------------- 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 -----------------------------------------------------------------