auto-generating XML generator functions [was: very XiMpLe XML validation]

meik michalke meik.michalke at uni-duesseldorf.de
Tue Feb 9 22:29:58 UTC 2016


hi again ;-)

Am Dienstag, 9. Februar 2016, 22:34:30 schrieb Thomas Friedrichsmeier:
> On Sun, 07 Feb 2016 23:29:25 +0100 meik michalke <meik.michalke at uni-
> duesseldorf.de> wrote:
> > yet another train ride... thomas suggested something similar to this
> > way back, and now it's possible: XiMpLe just gained a new method for
> > objects of class XiMpLe.validity, to generate XML generators from it.
> 
> I'm glad I gave you that idea, or something similar, somehow, although
> I don't really remember doing so ;-)

it was a looong time ago, something like "shouldn't we write a DTD file and 
get all these functions generated automatically?", which couldn't be done 
because XiMpLe had (and still has) no clue how to interpret DTD. the idea 
stuck in my mind.

> So, if I understand this, correctly, this holds the potential to
> auto-generate a lot of the code that is in the rkwarddev-package,
> today? Though, in the end, the more interesting (and hard) bit is
> probably providing useful documentation and examples for each of the
> generated generator functions...

well, i consider the generated code as it is today more or less as an 
elaborate starting point. it's doubtful that for several reasons (like the 
ones you've mentioned) this will generate as good documentation as the package 
(hopefully) has now. so i'm not planning on replacing half of the package just 
yet ;-)

> Looking at this really broadly, I wonder: Perhaps the _most_ useful
> thing would actually be to generate a single (internal) "workhorse"
> generator function that will take the tag name as parameter, and
> attributes / child nodes as lists.

this would actually work well if we only wanted to check for valid elements. 
but more complex checks like certain values of elements or "either this or 
that" or "must be exactly one node" can currently not be done automatically. 
this would add a lot more complexity to the validation -- a lot of it might be 
added one step at a time, but we're still far from it.

however, this already enables me to replace the manual validation i've put in 
all of the functions with a more general, robust and code saving solution. and 
new functions can mostly be written automatically, and then polished to a 
final state manually (e.g., adding all the i18n and help stuff).


viele grüße :: m.eik

-- 
  dipl. psych. meik michalke
  institut f"ur experimentelle psychologie
  abt. f"ur diagnostik und differentielle psychologie
  heinrich-heine-universit"at d-40204 d"usseldorf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20160209/c2203ebe/attachment.sig>


More information about the rkward-devel mailing list