text injection - two thoughts

I’ll try to develop a fuller note on this topic later, but for now I wanted to mention two ideas that I think might be relevant.

1 I think (subject to refutation by experiment) that both namespace injection and data injection into the XML might be handled syntactically using pragmas.  

By ‘pragmas' I mean annotations which can be acted on by processors which understand the particular pragmas used and which can be safely ignored by other processors.  I believe we already have a live issue suggesting that we add a syntax for pragmas, but in the meantime anyone who wants to experiment can use a syntax like {! identifier … !} for pragmas, with the result that other processors will just ignore them as comments.

2 I think (again subject to refutation) that attribute or affix grammars may be very helpful here in providing a well worked out theory to underpin the story.   

Perhaps all this means is that if we can find a way to explain text injection and other things in terms of an attribute grammar, it will feel less ad hoc and more rational.  But attribute grammars also provide a very clean story about the way a context free grammar can co-exist with additional information and additional rules and constraints.  (And because affix grammars are, ultimately, derived from van Wijngaarden grammars, they may fit very nicely here.  I need to brush up on how the affix grammar and an underlying context free grammar relate.)


This may be too cryptic, in which case I apologize.  But I am hoping it will be enough to spark some thoughts.

Michael

********************************************
C. M. Sperberg-McQueen
Black Mesa Technologies LLC
cmsmcq@blackmesatech.com
http://www.blackmesatech.com
********************************************

Received on Tuesday, 11 May 2021 16:55:19 UTC