lib/rdf.js
function createUpdateRDF(manifest) {
  var header = [{
    name: "RDF",
    attrs: {
      "xmlns": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
      "xmlns:em": "http://www.mozilla.org/2004/em-rdf#"
    },
    children: []
  }];
  var description = {
    name: "Description",
    attrs: {
      "about": "urn:mozilla:extension:" + getID(manifest)
    },
    children: []
  };
  var enginesDescription = {
    name: "Description",
    children: []
  };
  var updateRdfTree = {
    name: "em:updates",
    children: [
      {
        name: "Seq",
        children: [
          {
            name: "li",
            children: []
          }
        ]
      }
    ]
  };

  var jetpackMeta = {
    "em:version": manifest.version || "0.0.0"
  };
  enginesDescription.children.push(jetpackMeta);

  var engines = Object.keys(manifest.engines || {});
  // If engines defined, use them
  if (engines.length) {
    engines.forEach(function(engine) {
      enginesDescription.children.push(createApplication(
        engine, manifest.engines[engine]));
    });
  }
  // Otherwise, assume default Firefox support
  else {
    enginesDescription.children.push(createApplication("Firefox"));
  }
  //we add the updateLink for each engine
  enginesDescription.children.forEach(function(descriptionData, index) {
    if (descriptionData.hasOwnProperty("em:targetApplication")) {
      enginesDescription.children[index][Object.keys(descriptionData)].
        Description["em:updateLink"] = manifest.updateLink;
    }
  });

  updateRdfTree.children[0].children[0].children.push(enginesDescription);
  description.children.push(updateRdfTree);
  header[0].children.push(description);

  var xml = jsontoxml(header, {
    prettyPrint: true,
    xmlHeader: true,
    indent: "  ",
    escape: true
  });

  return xml;
}
function createUpdateRDF(manifest) {
  var header = [{
    name: "RDF",
    attrs: {
      "xmlns": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
      "xmlns:em": "http://www.mozilla.org/2004/em-rdf#"
    },
    children: []
  }];
  var description = {
    name: "Description",
    attrs: {
      "about": "urn:mozilla:extension:" + getID(manifest)
    },
    children: []
  };
  var enginesDescription = {
    name: "Description",
    children: []
  };
  var updateRdfTree = {
    name: "em:updates",
    children: [
      {
        name: "Seq",
        children: [
          {
            name: "li",
            children: []
          }
        ]
      }
    ]
  };

  var jetpackMeta = {
    "em:version": manifest.version || "0.0.0"
  };
  enginesDescription.children.push(jetpackMeta);

  var engines = Object.keys(manifest.engines || {});
  // If engines defined, use them
  if (engines.length) {
    engines.forEach(function(engine) {
      enginesDescription.children.push(createApplication(
        engine, manifest.engines[engine]));
    });
  }
  // Otherwise, assume default Firefox support
  else {
    enginesDescription.children.push(createApplication("Firefox"));
  }
  //we add the updateLink for each engine
  enginesDescription.children.forEach(function(descriptionData, index) {
    if (descriptionData.hasOwnProperty("em:targetApplication")) {
      enginesDescription.children[index][Object.keys(descriptionData)].
        Description["em:updateLink"] = manifest.updateLink;
    }
  });

  updateRdfTree.children[0].children[0].children.push(enginesDescription);
  description.children.push(updateRdfTree);
  header[0].children.push(description);

  var xml = jsontoxml(header, {
    prettyPrint: true,
    xmlHeader: true,
    indent: "  ",
    escape: true
  });

  return xml;
}
function createUpdateRDF ( manifest ) { var header = [ { name : "RDF" , attrs : { "xmlns" : "http://www.w3.org/1999/02/22-rdf-syntax-ns#" , "xmlns:em" : "http://www.mozilla.org/2004/em-rdf#" } , children : [ ] } ] ; var description = { name : "Description" , attrs : { "about" : "urn:mozilla:extension:" + getID ( manifest ) } , children : [ ] } ; var enginesDescription = { name : "Description" , children : [ ] } ; var updateRdfTree = { name : "em:updates" , children : [ { name : "Seq" , children : [ { name : "li" , children : [ ] } ] } ] } ; var jetpackMeta = { "em:version" : manifest . version || "0.0.0" } ; enginesDescription . children . push ( jetpackMeta ) ; var engines = Object . keys ( manifest . engines || { } ) ; // If engines defined, use them if ( engines . length ) { engines . forEach ( function ( engine ) { enginesDescription . children . push ( createApplication ( engine , manifest . engines [ engine ] ) ) ; } ) ; } // Otherwise, assume default Firefox support else { enginesDescription . children . push ( createApplication ( "Firefox" ) ) ; } //we add the updateLink for each engine enginesDescription . children . forEach ( function ( descriptionData , index ) { if ( descriptionData . hasOwnProperty ( "em:targetApplication" ) ) { enginesDescription . children [ index ] [ Object . keys ( descriptionData ) ] . Description [ "em:updateLink" ] = manifest . updateLink ; } } ) ; updateRdfTree . children [ 0 ] . children [ 0 ] . children . push ( enginesDescription ) ; description . children . push ( updateRdfTree ) ; header [ 0 ] . children . push ( description ) ; var xml = jsontoxml ( header , { prettyPrint : true , xmlHeader : true , indent : "  " , escape : true } ) ; return xml ; }
Creates an `update.rdf` file based off of an addon's `package.json`
object manifest. Returns a string of the composed RDF file.

@param {Object} manifest
@return {String}
Creates an update . rdf file based off of an addon s package . json object manifest . Returns a string of the composed RDF file .