Skip to content

csats/meteor-npm-libxmljs

Repository files navigation

libxmljs Meteor package

Build Status

This Meteor package wraps the libxmljs npm package.

Install

meteor add csats:libxmljs

Usage

This package exports XML. Example usage:

if (Meteor.isServer) {
  var xml = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n'
    + '<QuestionFormAnswers xmlns="http://mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2005-10-01/QuestionFormAnswers.xsd">\n'
    + '  <Answer>\n'
    + '    <QuestionIdentifier>Q2</QuestionIdentifier>\n'
    + '    <FreeText>Change your thoughts and you change the world.</FreeText>\n'
    + '  </Answer>\n'
    + '</QuestionFormAnswers>\n';
  // Warning: synchronous!
  var xmlDoc = XML.parseXml(xml);
  var actual = xmlDoc.get('//xmlns:FreeText', 'http://mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2005-10-01/QuestionFormAnswers.xsd').text();
  var expected = 'Change your thoughts and you change the world.';
  var assert = Npm.require('assert');
  assert.equal(actual, expected);
}

No Windows support

Sorry, this package doesn't work on Windows. see polotek/libxmljs#309.

See also

License

MIT

About

Meteor package wrapper for npm package libxmljs

Resources

License

Stars

Watchers

Forks

Packages

No packages published