monogatari

« cyber crime / axml:id | Main | the "true" Checklists: XML Performance »

DTLL 0.4

Jeni Tennison told me (well, some guys including me) that she put a refresh version of Datatype Library Language (DTLL), which is expected to be ISO DSDL part 5.

Since Mono already has validators for RELAX NG with custom datatype support and NVDL, there would be no wonder if I was trying to implement DTLL support.

The true history was earlier, but it was the last spring that I practically started to write code for DTLL version 0.3. After hacking on the grammar object model, I asked Jeni Tennison for some examples, and she was kind enough to give me a decent one (the latest specification now includes even nicer examples). With that I have finished the grammar object model.

The next was of course, compilation to be ready for validation. But at that stage I was rather ambicious to support automatic CLI type mapping from DTLL datatype. I thought it was possible, but I noticed that DTLL model was kinda non-deterministic ... that is, with that version of DTLL I had to implement some kind of backtracking of already-mapped part of data if the input raw string did not match in a certain choice branch. With some questions (such as why "enumeration" needs indirect designation by XPath), I asked her about the possibility of limitation of the flexibility of item-pattern syntax. In DTLL version 0.3, the definition of "list" was:

## Lists div { \list = element list { attribute separator { regular-expression }?, extension-attribute*, item-pattern+ } ## Item Patterns div { item-pattern |= group item-pattern |= choice item-pattern |= optional item-pattern |= zeroOrMore item-pattern |= oneOrMore item-pattern |= \list item-pattern |= item-datatype item-pattern |= item-value group = element group { extension-attribute*, item-pattern+ } choice = element choice { extension-attribute*, item-pattern+ } optional = element optional { extension-attribute*, item-pattern+ } zeroOrMore = element zeroOrMore { extension-attribute*, item-pattern+ } oneOrMore = element oneOrMore { extension-attribute*, item-pattern+ } item-datatype |= element data { extension-attribute*, type, param* } item-datatype |= anonymous-datatype item-value = element value { extension-attribute*, type?, text } } # End Item Patterns

... and today I was reading the latest DTLL 0.4, I noticed that:

## Lists div { \list = element list { attribute separator { regular-expression }?, extension-attribute* } } #End Lists

... so, the entire item-pattern went away (!). I was surprised at her decision, but I'd say, it is nice. List became just a list of strings... I wonder if it really cannot be typed pattern (I might be shooting my foot now). The specification also removed "enumeration", so the pattern syntax became pretty simple. This change means that almost all patterns are treated as regular expressions. I wonder if it is me to blame ;-)

Now I don't think it is possible to automatically generate "DTLL datatype to native CLI type" conversion code, but I think that such conversion code should be provided from DTLL users. So it seems time for me to restart hacking on it...

|