liveclipboard
Wednesday, July 26, 2006 8:13:03 PM
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.








FataL # Thursday, July 27, 2006 2:38:02 AM
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.
Eddie LopezEddie_Lopez # Thursday, July 27, 2006 7:50:12 PM
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?"
sypasche # Thursday, July 27, 2006 11:13:45 PM
I'll try to have a look tomorrow.
Hallvord R. M. Steenhallvors # Friday, July 28, 2006 11:00:48 AM
Hallvord R. M. Steenhallvors # Friday, July 28, 2006 11:02:22 AM
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.
sypasche # Friday, July 28, 2006 10:22:31 PM
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.
mattaugustine # Thursday, August 3, 2006 1:11:14 AM
João EirasxErath # Thursday, August 10, 2006 2:24:12 AM
João EirasxErath # Saturday, September 16, 2006 5:09:21 AM
Originally posted by sypasche:
Seems fixed