declarative4all icon indicating copy to clipboard operation
declarative4all copied to clipboard

Proposal: Separate DOM in DOM4 and Fleur enhancements

Open hfmanson opened this issue 3 years ago • 2 comments

Currently Fleur implements a complete DOM parser. I think it's a good idea to split it into a standard DOM implementation and upgrade that standard DOM implementation with Fleur enhancements.

This way when a browser is used, only the browser DOM implementation needs to be upgraded with Fleur enhancements. In standalone mode the Fleur implementation of standard DOM is used.

A cool feature is then to update the live browser DOM and the XML level document with statements like

    replace value of node $current-field/@state with 'visited',
    replace value of node $new-field/@state with 'current',
    replace value of node $current-svg-color with 'white',
    replace value of node $new-svg-color with 'black',

Also no serialisation and parsing is needed any more.

I implemented a proof of concept of this. Chainreaction and Boxup are two SVG games based on this proof of concept.

First an XML level is converted to an SVG XML element using XQuery. After that event handlers are added and processed by XQuery. See the javascript source in the games mentioned above. Event handlers read and modify the model but only write to SVG

hfmanson avatar Oct 08 '21 14:10 hfmanson

Fleur was, first, designed for Node.js. It was also intended to preserve DOM3 features within browsers while DOM4 and browser vendors specific points of view might alter them (an attribute is not a node anymore, and so on...). Fleur can be used to secure XSLTForms usage.

Because IE6 is not to be supported anymore, Fleur will be implemented as a Javascript module with, possibly, distinct features such as DOM3 and XQuery.

Do you consider that Fleur source size is a problem? Or is it because runtime performance is not good enough?

AlainCouthures avatar Oct 10 '21 12:10 AlainCouthures

It is not a size or performance issue. The advantage of using a browser DOM is being able to manipulate the live DOM tree using XQuery's update facility which is implemented in Fleur. So xqib can be implemented.

I now have those two games implemented as SVG files using only XQuery scripts! The only javascript is fleur.js Box Up and Chainreaction

hfmanson avatar Oct 10 '21 18:10 hfmanson