Last Comment Bug 205068 - Document JavaScript XPath usage
: Document JavaScript XPath usage
Status: RESOLVED WONTFIX
:
Product: Documentation
Classification: Graveyard
Component: Web Developer (show other bugs)
: unspecified
: All All
: -- normal (vote)
: ---
Assigned To: Axel Hecht
:
Mentors:
http://www.w3.org/TR/DOM-Level-3-XPath/
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2003-05-09 11:53 PDT by Heikki Toivonen (remove -bugzilla when emailing directly)
Modified: 2014-11-12 05:06 PST (History)
7 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments

Description Heikki Toivonen (remove -bugzilla when emailing directly) 2003-05-09 11:53:00 PDT
We need a small blurb on http://www.mozilla.org/projects/xslt/ that we support
the DOM Level 3 XPath API, a link to the spec, and a small example like we have
for XSLT from JS in here: http://www.mozilla.org/projects/xslt/js-interface.html

Also I would advice changing the main XSLT title to include XPath, something like:

XSL Transformations (XSLT) and XPath in Mozilla

I have gotten several requests recently asking about our XPath API support and
the best I could do was point them to the spec and the XSLT page. There
isna'treally anything that tells them we support it and figuring things out from
the spec is not trivial.
Comment 1 Heikki Toivonen (remove -bugzilla when emailing directly) 2003-05-19 10:58:33 PDT
Forgot the spec link, here it is: http://www.w3.org/TR/DOM-Level-3-XPath/
Comment 2 Heikki Toivonen (remove -bugzilla when emailing directly) 2003-06-03 10:57:25 PDT
I can check in the files if someone just provides the content...
Comment 3 Alec Flett 2003-06-03 14:16:09 PDT
You might get more responses if you posted a 1-2 paragraph description of how
this all works in this bug, to get things started. Someone else might take an
interested, learn about XPath, and write the document, you never know :)
Comment 4 Axel Hecht 2003-06-03 14:51:06 PDT
excuse me, we know that you want docs. Everybody does. Stop nagging.
There are more important things on the lists of those that actually would
contribute the content. There are even more important docs.
Comment 5 Jiri Znamenacek 2003-06-06 06:04:53 PDT
Seeing this bug I was playing with it once again:

A) I've downloaded MSXML 4.0 SP2, installed it, searched help, copied example
and in less then 15 minutes I've got the results I'd expected to get.

B) I've tried the same for DOM3 XPath and Mozilla willing to write the docs. In
about two hours I completely lost my feeling I understood it. And it's only two
weeks I needed XPath in some script... Perhaps wrong build number (20030605),
who knows...

OK, maybe I'm dumb. Oh yeah, from what I've heard from people trying to use
XPath2, XSLT2 and other XMLSchema based trash, I'm not the only one.
Comment 6 James Graham 2004-09-28 07:58:54 PDT
Hmm. I could maybe do this. How much information is required? Somthing like:
Basic calls (document.evaluate)
Return types (snapshots / iterators)
Namespace resolvers (difference between XHTML and HTML)

Or something less specific?
Comment 7 Axel Hecht 2004-09-28 08:34:33 PDT
Thank you for volunteering.

We should have examples for the common return types, and how to work on HTML and
XML documents, the latter with and without namespaces. Make an example using
a node as namespace resolver as well as an explicit js one, so that users see
how to work with default namespaces.

This sounds like quite a bit of work, but I'd be fine with landing this in chunks.
Comment 8 James Graham 2004-10-15 01:39:44 PDT
OK, so I've done a little here but work has temporarily stalled. There's a
snapshot of the work-in-progress at
http://www-jcsu.jesus.cam.ac.uk/~jg307/mozilla/xpath-tutorial.html
Comment 9 Axel Hecht 2004-10-19 05:39:36 PDT
(In reply to comment #8)
> OK, so I've done a little here but work has temporarily stalled. There's a
> snapshot of the work-in-progress at
> http://www-jcsu.jesus.cam.ac.uk/~jg307/mozilla/xpath-tutorial.html

I looked over this, it's a pretty good start. A few comments though. On the 
source, mozilla.org content is short lines, not a single line per paragraph.
The markup is probably allright, didn't check that closely. I assume that you 
followed http://www.mozilla.org/contribute/writing/guidelines, as you use the 
m.o stylesheets already.

I'm no big fan of //foo expressions, as you used them like /descendent::foo,
which is faster. In most cases, it won't really matter, but I'd prefer to see
us giving good examples (yes, one can optimize that in the engine, too).

In the XML part, you should call HTML XHTML, just to make the difference clear.
Are you going to provide us with an example, too?

There are a few edges in the english, but I guess we'll iron those out later.
Comment 10 Jonas Sicking (:sicking) 2004-10-19 08:35:45 PDT
IMHO //foo expressions are clearer to read so I think that's what should be used
in helppages. It might be a good idea to have an optimization section though
where // vs. descendant:: is discussed.
Comment 11 Florian Scholz [:fscholz] (MDN) 2014-11-12 05:06:58 PST
This bug has been buried in the graveyard and has not been updated in over 10 years. It is probably safe to assume that it will never be fixed, so resolving as WONTFIX.

Please file new issues against MDN in the "Developer Documentation" product.
https://developer.mozilla.org/en-US/docs/Web/XPath

Note You need to log in before you can comment on or make changes to this bug.