Bookmarklet for XPath/CSS Path

228 views
Skip to first unread message

Lennart Borgman

unread,
Jan 29, 2012, 7:18:42 AM1/29/12
to zoter...@googlegroups.com
I have made a bookmarklet that makes it a bit easier to get an XPath expression. Is someone is interested it is here:

http://dl.dropbox.com/u/848981/it/xp/xp.html 

adamsmith

unread,
Jan 29, 2012, 3:12:38 PM1/29/12
to zotero-dev
what does this do that Firebug/Xpather or Chrome's built-in analyzer
don't?

Avram Lyon

unread,
Jan 29, 2012, 9:54:55 PM1/29/12
to zoter...@googlegroups.com
Well, it is much better than Firebug's generated XPath; don't know
much about the others. This definitely makes it easy to compose and
test a minimally complex XPath using a light-weight approach. Thanks
for contributing this! I'll make sure to point it out in the
translator docs.

Between this, Scaffold, and Framework, I think we can make writing a
translator pretty easy, with the right docs/tutorial.

Avram

> --
> You received this message because you are subscribed to the Google Groups "zotero-dev" group.
> To post to this group, send email to zoter...@googlegroups.com.
> To unsubscribe from this group, send email to zotero-dev+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/zotero-dev?hl=en.
>

Lennart Borgman

unread,
Jan 29, 2012, 10:03:48 PM1/29/12
to zoter...@googlegroups.com
Thanks Avram. To get a better path was the purpose. (I also sometimes need a CSS Path so it can do that too.)

Yes, it looks pretty easy now, once you have been pointed to the correct documentation. Maybe for the translator framework the possibility to use anonymous functions for the argument side should be pointed out too?

Lennart Borgman

unread,
Jan 29, 2012, 10:05:03 PM1/29/12
to zoter...@googlegroups.com
I just updated the bookmarklet. Should be faster and work ok in FF too now. (I am testing in Chrome mostly.)

adamsmith

unread,
Jan 29, 2012, 10:48:46 PM1/29/12
to zotero-dev
ah, I see - that's quite neat, yes. Thanks for putting it up.

Avram Lyon

unread,
Feb 13, 2012, 3:39:34 AM2/13/12
to zoter...@googlegroups.com
Would you be amenable to putting this under an appropriate license and
posting it somewhere like Github? I'm a bit wary of relying on the
dropbox link as a permanent home, and I don't want this useful script
to just disappear unexpectedly from the net at some point.

Avram

Theaetetus

unread,
Feb 13, 2012, 10:46:54 PM2/13/12
to zotero-dev
This booklet is a great idea, and could be really helpful.
When I modify the XPath to something more general, it doesn't seem to
highlight all of the results. Is that a bug? It would be nice if it
could highlight all results.
Thanks for your work!


On Jan 29, 10:05 pm, Lennart Borgman <lennart.borg...@gmail.com>
wrote:

Lennart Borgman

unread,
Feb 14, 2012, 7:50:32 AM2/14/12
to zoter...@googlegroups.com
Theaetetus, if you give me an example I will look into it.

Lennart Borgman

unread,
Feb 14, 2012, 7:53:12 AM2/14/12
to zoter...@googlegroups.com
Yes, I will put it on Launchpad.com where I usually put some things.

For the moment I want to keep the location of the script to dropbox
since that makes it much easier to fix small bugs. After a short
period I hope it can be hosted for example by zotero.org. (I have a
domain on my own, OurComments.org, but it is slow and https is not
that well supported there.)

Lennart Borgman

unread,
Aug 9, 2012, 6:38:45 PM8/9/12
to zoter...@googlegroups.com
The code is on Launchpad now: https://launchpad.net/xcpath-bm

Lennart Borgman

unread,
Aug 9, 2012, 6:40:23 PM8/9/12
to zoter...@googlegroups.com
Hm, forgot to say there are some more to add, like the building
script. However that is mostly for convenience perhaps.
Reply all
Reply to author
Forward
0 new messages