php-technolog / wicked-good-xpath

Automatically exported from code.google.com/p/wicked-good-xpath
0 stars 0 forks source link

Allow installation on other nodes then document #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
More a feature request then a real issue I guess..
Would be nice to get a usage like:
xml.evaluate( etc....

wgxpath.install(window,node)

Original issue reported on code.google.com by plakr...@gmail.com on 22 Oct 2012 at 1:54

GoogleCodeExporter commented 9 years ago
Ah, just found issue #1
Well, I guess I'm out of luck on this one....still, it would be a good idea to 
be able to install on other then document. This lib gain popularity when doing 
so....
Please reconsider.

Original comment by plakr...@gmail.com on 22 Oct 2012 at 2:49

GoogleCodeExporter commented 9 years ago
plakroon, I'm curious what motivated this request. Which browser does not 
provide XMLElement.evaluate in XML documents?

Original comment by gden...@google.com on 22 Oct 2012 at 2:58

GoogleCodeExporter commented 9 years ago
IE

Original comment by plakr...@gmail.com on 22 Oct 2012 at 2:59

GoogleCodeExporter commented 9 years ago
Does "xmlDocument.selectSingleNode / selectNodes" work for you on IE?

Original comment by zhoumoto...@gmail.com on 22 Oct 2012 at 6:38

GoogleCodeExporter commented 9 years ago
Yes it does.
I used this demo for testing: 
http://www.w3schools.com/xpath/tryit.asp?filename=try_xpath_select_cdnodes_first
IE6SP1

Original comment by plakr...@gmail.com on 22 Oct 2012 at 10:27

GoogleCodeExporter commented 9 years ago
One question I have is what the specification is for the XML DOM, in terms of 
its JavaScript API. We have tried to make the library make the browser appear 
to have specification-compliant XPath behavior, but what the W3C thinks the XML 
DOM should expose is a little unclear to me. If an XML DOM is supposed to have 
the same API as an HTML DOM, then there is an argument for our attaching the 
evaluate method to XML documents as well -- and make it delegate to 
selectNodes/selectSingleNode on IE. I could be wrong, but don't believe there 
is any spec that says an XMLElement should expose an evaluate method. If anyone 
on this thread knows of any relevant specs here, please link to them, because 
my searching isn't turning up much.

Original comment by gden...@google.com on 23 Oct 2012 at 7:48

GoogleCodeExporter commented 9 years ago
I'll try to find some W3C spec if any.
However, all modern browsers allow for XMLElement.evaluate.
For consistancy it would make sense to implement usage for IE.
XPath is xml related, so XMLElement.evaluate makes sense.

Look here: http://www.w3.org/TR/1999/REC-xpath-19991116/
[quote]
Abstract

XPath is a language for addressing parts of an XML document, designed to be 
used by both XSLT and XPointer.
[/quote]

And look here: 
http://www.w3.org/TR/1999/REC-xpath-19991116/#section-Introduction

Original comment by plakr...@gmail.com on 24 Oct 2012 at 1:22

GoogleCodeExporter commented 9 years ago
I'm merging this into the feature request that this library support XML 
documents.

Original comment by gden...@google.com on 10 Sep 2013 at 7:16