Allow multiple <definitions> elements in publish.xml.
--- a/publish/config.js Sat Aug 18 18:29:01 2012 +1000
+++ b/publish/config.js Sun Aug 19 16:27:16 2012 +1000
@@ -139,10 +139,13 @@
this.attributeIndex = attr(root, 'attributeindex', 'href');
this.propertyIndex = attr(root, 'propertyindex', 'href');
- this.definitionsFile = attr(root, 'definitions', 'href');
- if (this.definitionsFile) {
- this.definitions = definitions.load(this.definitionsFile);
+ var definitionsFilenamesAndBases = [];
+ for (var n = root.firstChild; n; n = n.nextSibling) {
+ if (n.nodeName == 'definitions') {
+ definitionsFilenamesAndBases.push([n.getAttribute('href'), n.getAttribute('base') || null]);
+ }
}
+ this.definitions = definitions.load(definitionsFilenamesAndBases.reverse());
this.interfacesFile = attr(root, 'interfaces', 'idl');
this.pages = { };
--- a/publish/definitions.js Sat Aug 18 18:29:01 2012 +1000
+++ b/publish/definitions.js Sun Aug 19 16:27:16 2012 +1000
@@ -468,9 +468,11 @@
}
}
-exports.load = function(filename) {
+exports.load = function(filenamesAndBases) {
var defs = new Definitions();
- loadInto(filename, null, defs);
+ for (var i = 0; i < filenamesAndBases.length; i++) {
+ loadInto(filenamesAndBases[i][0], filenamesAndBases[i][1], defs);
+ }
resolve(defs);
return defs;
};