On 1/16/2016 4:55 PM, Kate F wrote:
On 16 January 2016 at 00:33, Hans Hagen
wrote: On 1/15/2016 9:20 PM, Thomas A. Schmitz wrote:
On 01/15/2016 06:58 PM, Kate F wrote:
So I see! But many DTDs contain definitions for entities, which I would like to use, rather than repeating those definitions by \xmlsetentity in ConTeXt. Some XML documents also have their own document-specific entities inside the DOCTYPE at the top of the file.
For example in legal agreements, I have something like:
<?xml version="1.0"?> <!DOCTYPE blah SYSTEM "blah.dtd" [ <!ENTITY us "the company"> <!ENTITY you "the customer"> ]>
Where the stuff inside [...] is considered part of a document-specific DTD. libxml2 handles this sort of thing with its "dtdattr" options; I presume lxml has something similar.
AFAIK, ConTeXt has its own xml parser based on lua lpeg, see file lxml-tab.lua. There is code there that treats entities, but I have never used this approach, so you'll probably have to wait till Hans looks at your question (or understand the lua code...)
i'll come back to it ... fyi: these doctype entities are already parsed in mkiv .. just not used (or maybe it got lost when fulfilling other wishes)
Much appreciated, if you would. Thank you! Is it just a case of having that parsing call \xmlsetentity?
it should work in the in beta now ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------