[NTG-context] TeX in \xmlsetentity and DTDs in DOCTYPEs

Kate F kate at elide.org
Sat Jan 16 16:55:01 CET 2016


On 16 January 2016 at 00:33, Hans Hagen <pragma at wxs.nl> 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?

-- 
Kate


More information about the ntg-context mailing list