Skip navigation.

exploreopera

| Help

Sign up | Help

liveclipboard

, , , ,


liveclipboard is an interesting idea from Ray Ozzie. He's also blogged the process and brainstorming behind it. This is great..

Unfortunately it doesn't work in Opera.

The reason appears to be a bug in FireFox regarding how it evaluates XPath expressions. The document.evaluate spec states that the context node must belong to the same document as the method is called on. (The style is somewhat convoluted, I'm not 100% sure I've understood the phrase If the XPathEvaluator was obtained by casting the Document correctly but I can't think of any other reading that makes sense).

So, if you call document.evaluate( expression, someOtherDocument ...), Opera follows the spec to the t and throws an exception while FireFox doesn't. The liveclipboard script relies on this FireFox bug.

The fix is simple: import the nodes to the current document before XPathing them. For example:

hCardXmlNode = domParser.parseFromString(hCardXmlString, 'application/xml');


should be

hCardXmlNode = document.importNode(domParser.parseFromString(hCardXmlString, 'application/xml').firstChild, true);


One of these cases where testing in multiple browsers will highlight your assumptions about web standards.

my booking form is a secretWhen specs and implementations clash

Comments

avatar
One of these cases where testing in multiple browsers will highlight your assumptions about web standards.
That's what I always told people when see them testing only in Firefox and IE.
Based on my experience I can say that sometimes even testing in 4 browsers doesn't help, and you need to test in previous versions of browsers too. :wink:

By FataL, # 27. July 2006, 02:38:02

avatar
Technical issues aside, this is a great idea!

I worked on pub/sub, xml based tools in the Air Force and this seems like a nice killer app (at least, demo) that can easily show people usefulness of this idea.

I can't remember the number of times we'd demo pub/sub and what it could do.. only to get an answer back like:

"so... it's like google?"

By Eddie_Lopez, # 27. July 2006, 19:50:12

avatar
Maybe there's an open Firefox bug about that. Did you look for it?

I'll try to have a look tomorrow.

By sypasche, # 27. July 2006, 23:13:45

avatar
Something else the liveclipboard devs should fix is that the script currently throws embarassing JS errors if you paste something that isn't XML :smile:

By hallvors, # 28. July 2006, 11:00:48

avatar
sypasche: yes, I tried looking for a Firefox bug. I couldn't find anything that looked directly relevant. If you want to file one there is a pretty good test case here:
http://www.hallvord.com/opera/demo/x-doc-evaluate.htm
feel free to refer to this blog post too, of course.

I would appreciate if you post the bug number here so that I can CC myself over there and keep an eye on it.

By hallvors, # 28. July 2006, 11:02:22

avatar
I could not find a bug about it either. I filed https://bugzilla.mozilla.org/show_bug.cgi?id=346362

I have put your testcase on that bug that I had from my cache, as www.hallvord.com is not reachable for me right now.

By sypasche, # 28. July 2006, 22:22:31

avatar
Thanks for the investigation. I'll try your suggestion and, if I get it to work, incorporate it into the next update of our control on the example page.

By mattaugustine, # 3. August 2006, 01:11:14

avatar
it seems Gecko has relaxed error handling for many thngs, specially xsl :smile:

By xErath, # 10. August 2006, 02:24:12

avatar

Originally posted by sypasche:

I could not find a bug about it either. I filed https://bugzilla.mozilla.org/show_bug.cgi?id=346362
Seems fixed :smile: good ! less one annoyance.

By xErath, # 16. September 2006, 05:09:21

Write a comment

You must be logged in to write a comment. if you're not a registered member, please sign up.