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

Hans Hagen pragma at wxs.nl
Sat Jan 16 01:33:05 CET 2016


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)

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the ntg-context mailing list