From b2c48728a3ea910d284d5807ed85e9ecdd891f1d Mon Sep 17 00:00:00 2001 From: Wesley Moore Date: Sat, 29 Jan 2011 04:45:05 +1100 Subject: [PATCH] Finish off generating-xml-with-node-js --- .../2011/01/generating-xml-with-node-js.html | 33 ++++++++++++------- .../2011/01/generating-xml-with-node-js.yaml | 6 +++- .../01/generating-xml-with-node-js/atom.js | 0 .../generating-xml-with-node-js/xmlpipe2.js | 3 -- 4 files changed, 27 insertions(+), 15 deletions(-) delete mode 100644 output/technical/2011/01/generating-xml-with-node-js/atom.js delete mode 100644 output/technical/2011/01/generating-xml-with-node-js/xmlpipe2.js diff --git a/content/technical/2011/01/generating-xml-with-node-js.html b/content/technical/2011/01/generating-xml-with-node-js.html index 9028b4a..09846b2 100644 --- a/content/technical/2011/01/generating-xml-with-node-js.html +++ b/content/technical/2011/01/generating-xml-with-node-js.html @@ -1,34 +1,45 @@ For a [node.js][node] project I'm working on I wanted to generate a [Sphinx -xmlpip2e][xmlpipe] data stream. The options for generating XML with node.js +xmlpipe2][xmlpipe] data stream. The options for generating XML with node.js seemed a bit limited. The main contender appeared to be [libmljs] but it -segfaulted whenever I tried to use it. A browse of the issue tracker seemed to -suggest the project was quite complex and crashing problems were not uncommon. - -[node]: http://nodejs.org/ -[xmlpipe]: http://sphinxsearch.com/docs/manual-1.10.html TODO -[libmljs]: https://github.com/polotek/libxmljs - -So with previous experience using Tim Bray's Genx library I decieded to write +segfaulted whenever I tried to use it. So with previous experience using Tim Bray's [Genx][genx] C library I decided to write bindings for node. The result is [node-genx], which is available via [npm]. npm install genx +[node]: http://nodejs.org/ +[xmlpipe]: http://sphinxsearch.com/docs/manual-1.10.html#xmlpipe2 +[libmljs]: https://github.com/polotek/libxmljs [node-genx]: https://github.com/wezm/node-genx +[genx]: http://www.tbray.org/ongoing/When/200x/2004/02/20/GenxStatus [npm]: http://npmjs.org/ Example Usage ------------- +Provided below are a couple of examples of using the genx module. To run them you will need the following modules, the version +used at the time of writing is noted in brackets. The examples were developed +against node.js v0.2.6. + +* jquery (1.4.4) +* jsdom (0.1.20) +* genx (0.8.0) +* node-uuid (1.1.0) + +These packages can be installed via npm. Note that jsdom is omitted from the list because +it is a dependency of jquery: + + npm install jquery genx node-uuid + ### xmlpipe2 In this example the first 10 Google search results for "node.js xml" are retrieved and converted into an xmlpipe2 stream, suitable for indexing with Sphinx. - + ### Atom Feed In this example, as in the former the first 10 Google search results for "node.js xml" are retrieved and converted into an Atom feed. - + diff --git a/content/technical/2011/01/generating-xml-with-node-js.yaml b/content/technical/2011/01/generating-xml-with-node-js.yaml index caa44cf..b557283 100644 --- a/content/technical/2011/01/generating-xml-with-node-js.yaml +++ b/content/technical/2011/01/generating-xml-with-node-js.yaml @@ -1,6 +1,6 @@ --- title: Generating XML With node.js -extra: Using my genx node module to generate XML in node.js. +extra: Examples using my genx node module to generate XML in node.js. kind: article section: technical created_at: 2011-01-28 06:18:00 @@ -9,3 +9,7 @@ keywords: - js - xml - generation +- atom +- feed +- sphinx + diff --git a/output/technical/2011/01/generating-xml-with-node-js/atom.js b/output/technical/2011/01/generating-xml-with-node-js/atom.js deleted file mode 100644 index e69de29..0000000 diff --git a/output/technical/2011/01/generating-xml-with-node-js/xmlpipe2.js b/output/technical/2011/01/generating-xml-with-node-js/xmlpipe2.js deleted file mode 100644 index b824e60..0000000 --- a/output/technical/2011/01/generating-xml-with-node-js/xmlpipe2.js +++ /dev/null @@ -1,3 +0,0 @@ -var genx = require('genx'); - -// Retrieve the Google search results