I'm sorry if this putting things in context is a bit verbose; it might
not be necessary to address my question, which follows the double
paragraph break. It might on the other hand be pleasant reading on a
refreshing take on Exhibit that I woke up with this morning, and have
hacked a bit at since then.

The thought is perhaps best described as a cross-pollination between
ideas like Piggy Bank, Sifter and Exhibit, in one. On any page with
scrapable data, offer a scrape interface and a way of invoking Exhibit
on the data to browse, filter and reshape it, at once. Presently (and
perhaps indefinitely so) it is a very programmer-facing user interface
and runs in firefox with the greasemonkey (and firebug; still much
debug code strewn in there) extension and a smallish user script that
brings Exhibit to the data:

http://ecmanaut.googlecode.com/svn/trunk/sites/*/exhibit-self-injector-thickbox.user.js

Once installed, the UI is best described by example, so I'll pick a
fairly structured table I'd like to soak up into Exhibit, a view on
automated test builds across multiple operating systems of the Pike
programming language:

http://pike.ida.liu.se/development/pikefarm/7.7.xml

With the user script in place, a "[Configure]" link should pop up in
the lower right corner of the window. Clicking it brings about a view
offering three XPath selectors, from top to bottom:
- a root/context node reference, which we want to point to the table
element (convenience to make relative, readable expressions later on).
Fill in //[EMAIL PROTECTED]"xf"] for now.
- a row/item selector, listing an XPath expression relative to the
root node that should pick upp all the items we want to scoop up (for
now it's just one set of items). Type tbody/tr to fetch every build
machine row.
- a Fields selector, prepopulated with the field name "label". Fill in
td[last()]/text() to get the name of the os and build flags.

We might like to Add Another Field or two, let's say a host and a
status field for the latest build; fill in host and td/text() for the
second and status and td[last()-1]/a/img/@alt for the third field.
Clicking Render Exhibit invokes Exhibit's freshly acquired XPath
vision, which sees through the template and liberates the page data,
showing it in the minimum-setup Exhibit view of the data. (Pardon the
current total lack of layout; I'm better with code than aesthetics,
and this hack is merely hours old.)


Anyway, here comes my problem:

When trying to instrument the exhibit-browse-panel with an ex:facets
attribute, I get an "invalid XML namespace ex" error. I'm using the
E4X support of firefox to make code more pleasant to work with, but it
does force me to get things like namespaces right, and it's largely
unfamiliar territory to me where I need to define them and how, to get
past the gates. (The bit that runs into this issue is commented out,
at the end of render_exhibit() -- so you can try it in its default
glorious lack of features rather than hit an error without having seen
anything fun.)

Any input on what I ought to do to declare the ex namespace on the
pages that get hijacked would be very welcome. (This is an early
stopper for some of the functionality I want this baby to grow. :-)

-- 
 / Johan Sundström, http://ecmanaut.blogspot.com/

_______________________________________________
General mailing list
[email protected]
http://simile.mit.edu/mailman/listinfo/general

Reply via email to