From 3c1e3f5fee9e0a4c1dde50cf02ff0eee424a6c47 Mon Sep 17 00:00:00 2001 From: Wesley Moore Date: Fri, 28 Jan 2011 06:57:51 +1100 Subject: [PATCH] Add generating-xml-with-node-js --- .../2011/01/generating-xml-with-node-js.html | 34 +++++++++++++++++++ .../2011/01/generating-xml-with-node-js.yaml | 11 ++++++ .../01/generating-xml-with-node-js/atom.js | 0 .../generating-xml-with-node-js/xmlpipe2.js | 3 ++ 4 files changed, 48 insertions(+) create mode 100644 content/technical/2011/01/generating-xml-with-node-js.html create mode 100644 content/technical/2011/01/generating-xml-with-node-js.yaml create mode 100644 output/technical/2011/01/generating-xml-with-node-js/atom.js create 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 new file mode 100644 index 0000000..9028b4a --- /dev/null +++ b/content/technical/2011/01/generating-xml-with-node-js.html @@ -0,0 +1,34 @@ +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 +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 +bindings for node. The result is [node-genx], which is available via [npm]. + + npm install genx + +[node-genx]: https://github.com/wezm/node-genx +[npm]: http://npmjs.org/ + +Example Usage +------------- + +### 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 new file mode 100644 index 0000000..caa44cf --- /dev/null +++ b/content/technical/2011/01/generating-xml-with-node-js.yaml @@ -0,0 +1,11 @@ +--- +title: Generating XML With node.js +extra: Using my genx node module to generate XML in node.js. +kind: article +section: technical +created_at: 2011-01-28 06:18:00 +keywords: +- node +- js +- xml +- generation 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 new file mode 100644 index 0000000..e69de29 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 new file mode 100644 index 0000000..b824e60 --- /dev/null +++ b/output/technical/2011/01/generating-xml-with-node-js/xmlpipe2.js @@ -0,0 +1,3 @@ +var genx = require('genx'); + +// Retrieve the Google search results