Rackspace Open-Sources A Node.js Library for Creating and Parsing XML Documents
The issues that come with connecting the legacy enterprise to the cloud mean dealing with heavyweight technologies such as XML. To that end, Rackspace developers have built and open-sourced a library for creating XML documents called “node-elementtree,” a Node.js Library to build and parse XML documents.
Tomaz Muraus writes on the Rackspace blog that none of the developers really care for XML but they have to support it as some of its API customers still use it. They prefer JSON instead, the chosen lightweight service for developers everywhere.
The need for node-elementtree came as Rackspace started building out a monitoring-as-a-service (MaaS) platform. As more data moves to cloud environments there is an interdependency that IT needs to understand. MaaS is intended to help in that effort.
Rackspace developers found that there wasn’t a good library available for creating XML documents. So the team decided to build their own.
The group decided to model its library on the Python-based ElementTree, an API for parsing XML. According to the Python.org site, the Element Tree API “is a flexible container object, designed to store hierarchical data structures in memory.”
The Rackspace blog post provides examples for creating and parsing XML documents.
Rackspace uses node-elementtree for MaaS in two places:
1. Sending usage documents to an Atom Hopper instance
2. Returning a response to the API user which has requested a response format to be XMLIn the second case we actually use it in combination with our validation and serialization framework called Swiz. We use Swiz to define field types and validators for every object in the system. When a user hits our API and requests XML, Swiz serializes the response using the object definition and node-elementtree library.
Rackspace has in recent months also contributed Whiskey, a Node.js test framework and the Cassandra CQL driver, a driver for Node.js.
There is a recognition that XML has to be dealt with as API customers still use it. node-elementtree offers a modern way to build and parse XML documents in an environment more friendly to a new generation of developers.
Since you’re here …
… We’d like to tell you about our mission and how you can help us fulfill it. SiliconANGLE Media Inc.’s business model is based on the intrinsic value of the content, not advertising. Unlike many online publications, we don’t have a paywall or run banner advertising, because we want to keep our journalism open, without influence or the need to chase traffic.The journalism, reporting and commentary on SiliconANGLE — along with live, unscripted video from our Silicon Valley studio and globe-trotting video teams at theCUBE — take a lot of hard work, time and money. Keeping the quality high requires the support of sponsors who are aligned with our vision of ad-free journalism content.
If you like the reporting, video interviews and other ad-free content here, please take a moment to check out a sample of the video content supported by our sponsors, tweet your support, and keep coming back to SiliconANGLE.