Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Developer
NinjaCoder
Posts: 27
Registered: ‎07-24-2009
My Device: Not Specified
Accepted Solution

window.XMLDocument missing

Anyone notice that window.XMLDocument is missing?

Did you guys write a new version of it? Or do you just not use those properties?

Please use plain text.
Developer
Posts: 107
Registered: ‎09-25-2008
My Device: Not Specified

Re: window.XMLDocument missing

What properties do you need, exactly?
Please use plain text.
Developer
NinjaCoder
Posts: 27
Registered: ‎07-24-2009
My Device: Not Specified

Re: window.XMLDocument missing

Actually I am not 100% sure.

 

I maintain a library that does something similar to what this article is doing:

 

http://www.codingforums.com/archive/index.php/t-81233.html
// add [object XMLDocument].xml support for gecko-based browsers.
if (window.XMLDocument && XMLDocument.prototype && XMLDocument.prototype.__defineGetter__) {
XMLDocument.prototype.__defineGetter__("xml", function() {
return (new XMLSerializer).serializeToString(this);
});
Node.prototype.__defineGetter__("xml", function() {
return (new XMLSerializer).serializeToString(this);
});

 

But on a Blackberry (4.6/4.7 curve/bold/storm) window.XMLDocument is undefined.

 

The exact properties I add to window.XMLDocument are:
transformNodeToObject, loadXML, transformNode, setProperty, selectNodes, selectSingleNode

 

But technically I dont know who uses them or if people are expecting some other property to exist that I dont add.

 
I found 1 site that does:
if(typeof XMLDocument == "undefined" && typeof Document !="undefined"){ XMLDocument = Document; }


Would this acheive what I desire?

Please use plain text.
Developer
Posts: 107
Registered: ‎09-25-2008
My Device: Not Specified

Re: window.XMLDocument missing

Yeah, setting XMLDocument to Document looks like it would work and do what you need.
Please use plain text.