Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Xpath support?

Does anybody know if Safari supports Xpath in Javascript? I've seen some documetation on the web that says "no", but not enough to really convince me. Then again, I've not seen any documentation that says it does support Xpath.

Mini, Mac OS X (10.4.6)

Posted on Jun 7, 2006 9:51 AM

Reply
7 replies

Jun 7, 2006 10:20 AM in response to Eme

Hello Ben & Welcome to Apple Discussion,

Is this what you mean :
http://www.w3schools.com/xpath/default.asp
or http://www.stylusstudio.com/xpath.html

More info please: )


Yes, this is what I mean. I am a web developer, and would like to use Xpath to query an XML object in Javascript. In IE, I can do that with the "selectNodes" and "selectSingleNode" functions, like this:

var xpathresults = myXmlDoc.selectNodes(myXpath);
var xpathresult = myXmlDoc.selectSingleNode(myXpath);


In Mozilla, I can do that with the "evalute" function, like this:

var xpathresult = myXmlDoc.evaluate(myXpath, myXmlDoc, myNamespaceResolver, XPathResult.ORDERED NODE_SNAPSHOTTYPE, null);

I am trying to determine if there's any way I can do that in Safari.

Thanks,
Ben

Jun 7, 2006 3:20 PM in response to Eme

That's a really useful page! Except it's wrong. That page has Internet Explorer down for not supporting Xpath queries, when I know for a fact that it does.

I can't believe Wikipedia could be wrong! (-:

Anyway, the page says that Safari does not support Xpath, but I don't know whether to believe that now or not.

Regardless, thanks for your help.

Jun 7, 2006 4:10 PM in response to Ben Mueller

That's a really useful page! Except it's wrong. That page has
Internet Explorer down for not supporting Xpath queries, when
I know for a fact that it does.


Hi, goes to show you never know with these wiki's ; ) You are welcome ,
it is not much in the way of help, (~: thanks for the helpul star.
I do hope someone chimes in with more help.

Perhaps this will be helpful in your work Apple Mailing Lists. Good Luck.

Eme;~[)

Xpath support?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.