Help getting started creating translators with Scaffold

I'm trying desperately to get started writing translators using Scaffold & I'm running into some frustrating (and likely *very* simple) problems.

To break the ice, I'm trying to get detectWeb() to recognize an extremely simple xml file. Even, with the simplest regex the Zotero icon never pops up when I open the file.

If my detectWeb() goes something like this I would think it would be pretty straightforward for a file named myxml.xml:

function detectWeb(doc, url) {

var myxml = new RegExp("myxml\.xml");
if(myxml.test(doc.location.href)) {
return "book";
}

But nothing happens. I've tried about 100 different things and no dice. I've checked ot make sure my translator is saving properly into the zotero.sqlite db. Is there something simple & logistical about creating a translator that I'm missing? Do I need to somehow commit or compile my work once I'm done?

Also, incidentally, I'm running to a "Permission denied to get property HTMLDocument.documentElement" exception when I try to test the translator code against a copy of the xml file hosted on my server. If I open the file locally I don't have the error (but then nothing happens anyway...see above). I understand this is a rule prohibiting cross-domain scripting, but I don't think I'm trying to cross domains with this one...

Thanks for helping out a newbie...
  • Better to post this on the dev list...
  • not sure about this, but i don't think the location class works within detectWeb, i.e., you can't say doc.location.href
Sign In or Register to comment.