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...) Thomas