advice on implementing "dynamic" properties

Manos Batsis manos_lists at geekologue.com
Sun Nov 14 20:48:35 GMT 2004


Dear developers,

I'm trying to refactor sarissa [sarissa.sf.net], an XML-stuff ecmascript
library work for Konqueror. My bigest issue currently is emulating IE
stuff like the .xml and innerHTML properties.

Up to now, the library only supported IE and Moz. As you probably know,
Moz provides __defineGetter__ and __defineSetter__ (which, i believe,
will be in ECMA-262 4th edition), which makes it possible to emulate IE
properties like .xml and .innerText, for example:

// emulate IEs .xml
XMLDocument.prototype.__defineGetter__("xml", function (){
   return (new XMLSerializer()).serializeToString(this);
});


My understanding is that Konqueror does not provide a way to achieve the
same and it's not really possible for me to interept any change to an
XML DOM to update such a property. Am i right? Is the definition of a
new method my only option? 

BTW: Are script bindings for XSLT transformations on the horizon?

Thanks for any help and a wonderfull product. 

Regards,

Manos
 






More information about the kfm-devel mailing list