Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
dev:how_to_write_a_zotero_translator_plusplus [2010/07/28 09:55] – split ch4 <html> into sections tomrochewiki | dev:how_to_write_a_zotero_translator_plusplus [2017/11/12 19:53] – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | < | ||
+ | in the process of updating the documentation for | ||
+ | <a href=" | ||
+ | may be outdated in the meantime. Thanks for your understanding.</ | ||
+ | |||
+ | |||
+ | **Note: This guide' | ||
+ | |||
===== Chapter 0: Introduction ===== | ===== Chapter 0: Introduction ===== | ||
Line 203: | Line 211: | ||
Be sure you have the most up to date version of Zotero. You can find this information on the [[http:// | Be sure you have the most up to date version of Zotero. You can find this information on the [[http:// | ||
- | ==== Scaffold | + | ==== Scaffold ==== |
- | install Scaffold from [[http://bitbucket.org/rmzelle/scaffold/downloads|here]] (temporarily) | + | Install |
The makers of Zotero created Scaffold specifically for writing translators. It's a sort of a " | The makers of Zotero created Scaffold specifically for writing translators. It's a sort of a " | ||
Line 581: | Line 589: | ||
===== Chapter 5: XPath directions ===== | ===== Chapter 5: XPath directions ===== | ||
- | [[http:/XPath directions/ | + | [[http:// |
The {DOM Inspector + XPather} workflow differs from that of Solvent. After opening the [[http:// | The {DOM Inspector + XPather} workflow differs from that of Solvent. After opening the [[http:// | ||
- | - Open DOM Inspector (aka //DI//) with C-S-i or from the Firefox main menu with Tools> | + | - Open DOM Inspector (aka //DI//) with CTRL+SHIFT+C or from the Firefox main menu with Tools> |
- Hit button=Inspect at the upper right of the DI window. This will open pane=Browser in the DI window displaying the contents of the first sample page. | - Hit button=Inspect at the upper right of the DI window. This will open pane=Browser in the DI window displaying the contents of the first sample page. | ||
- To test the XPath string denoting the heading (text=" | - To test the XPath string denoting the heading (text=" | ||
Line 639: | Line 647: | ||
- The URI of the sample page has changed since HWZT, so you will need to enter Target=< | - The URI of the sample page has changed since HWZT, so you will need to enter Target=< | ||
- Hit button=" | - Hit button=" | ||
- | - Instead of < | + | - Instead of < |
- | - In that tab enter < | + | - To excute code and debug, HWZT has you click an " |
+ | |||
+ | |||
+ | As noted at HWZT, example 11.4, certain code needs to be included inside the top of every Function in which you have an XPath (container). | ||
var namespace = doc.documentElement.namespaceURI; | var namespace = doc.documentElement.namespaceURI; | ||
var nsResolver = namespace ? function(prefix) { | var nsResolver = namespace ? function(prefix) { | ||
Line 650: | Line 661: | ||
Zotero.debug(myXPathObject); | Zotero.debug(myXPathObject); | ||
}</ | }</ | ||
- | - Click on icon=" | ||
- | The code for the second complete Scaffold example (from " | + | The code for the second complete Scaffold example (from " |
< | < | ||
var namespace = doc.documentElement.namespaceURI; | var namespace = doc.documentElement.namespaceURI; |