Extending the XML Node prototype

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Extending the XML Node prototype

rmaw
I have added custom methods and property getters to the XML DOM before
using javascript code such as:

document.prototype.myMethod = function(){ ...

Now I would like to add a custom getter to all instances of XML node
objects. The trouble is, I don't know what the name of the constructor
is. I'd assume something like:

xmlNode.prototype.myMethod = ...

But it doesnt' work. I have tried several variations of the "xmlNode"
but always get a javascript error that it doesn't exist. Does anybody
where I could figure out what the correct name for this is, or even if
it's possible?

Thanks!
_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Reply | Threaded
Open this post in threaded view
|

Re: Extending the XML Node prototype

Boris Zbarsky
On 12/23/09 7:17 PM, mawrya wrote:
> Now I would like to add a custom getter to all instances of XML node
> objects.

You can't do that in Gecko at the moment.  You can add something to all
"unknown" elements using Element.

-Boris
_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml