DOM/XPath Generator: Difference between revisions

m
GPHemsley moved page DOM:XPath Generator to DOM/XPath Generator without leaving a redirect
No edit summary
m (GPHemsley moved page DOM:XPath Generator to DOM/XPath Generator without leaving a redirect)
 
(5 intermediate revisions by 3 users not shown)
Line 39: Line 39:
namespace resolver (assuming that we need to handle XML to be future proof)." -- Alex Hecht
namespace resolver (assuming that we need to handle XML to be future proof)." -- Alex Hecht


[http://verbosio.mozdev.org Verbosio] would be able to translate a XPath for a document it's editing into a XPath for a XUL tree (a la DOM Inspector) representing the document's structure.  This would be through simple text replaces.  Thus, a node found in the master document would easily translate to a XUL tree item.
[http://verbosio.mozdev.org Verbosio] would be able to translate a XPath for a document it's editing into a XPath for a XUL tree (a la DOM Inspector) representing the document's structure.  This would be through simple text replacements.  Thus, a node found in the master document would easily translate to a XUL tree item.


Shane Caraveo at ActiveState is working to develop a XUL unit test extension that would work in a similar fashion to Selenium and Selenium Recorder.  This consists of recording DOM events, and saving an xpath to the event target so the target can found and used to replay an event.  Exploratory code is in [https://bugzilla.mozilla.org/show_bug.cgi?id=323938 bug 323938].
Shane Caraveo at ActiveState is working to develop a XUL unit test extension that would work in a similar fashion to Selenium and Selenium Recorder.  This consists of recording DOM events, and saving an xpath to the event target so the target can found and used to replay an event.  Exploratory code is in [https://bugzilla.mozilla.org/show_bug.cgi?id=323938 bug 323938].
Line 146: Line 146:
It would probably be a good idea to include a addNamespace(namespaceURI, prefix) method to the IDL, to point into the resolver's namespace map. -- Alex Vincent
It would probably be a good idea to include a addNamespace(namespaceURI, prefix) method to the IDL, to point into the resolver's namespace map. -- Alex Vincent


== [[XPath: Content Boundaries]] (non-normative) ==
I'd like the ability for a caller to tell the generator that it should identify the starting node by the content it contains when calling generateXPath.  We could do that by adding a searchFlag called something like IDENTIFY_START_BY_CONTENT which triggers the behavior.
 
When I say "identify the starting node by the content it contains", I mean use the contains() method or the like to filter nodes with the same tag name.  For example, for an XPath expression starting at a DIV node whose content is "foo", the beginning of the XPath expression should be DIV[contains(.,"foo")] or some other XPath construct which identifies the node by the content it contains. -- Myk Melez
 
== XPath: Content Boundaries ==
 
(non-normative)


Mozilla's XPath implementation doesn't currently support crossing boundaries between framed content and the container frame element, or between real content and its anonymous children.  Our XPath and XPathGenerator can be reasonably expected to support this in the future, so now's the best time to come up with a function syntax for doing this.
Mozilla's XPath implementation doesn't currently support crossing boundaries between framed content and the container frame element, or between real content and its anonymous children.  Our XPath and XPathGenerator can be reasonably expected to support this in the future, so now's the best time to come up with a function syntax for doing this.
Line 167: Line 173:
<sicking> at least i think not. at the very least we do not want to commit to it</pre>
<sicking> at least i think not. at the very least we do not want to commit to it</pre>


Please, whatever you think is a better syntax, please suggest it here.  All suggestions are welcome.
Whatever you think is a better syntax, please suggest it here.  All suggestions are welcome.
 
Implementation: [https://bugzilla.mozilla.org/show_bug.cgi?id=326745 bug 326745]
canmove, Confirmed users, Bureaucrats and Sysops emeriti
960

edits