00001
00002 (function() {
00003 var XMLAttribute;
00004
00005 module.exports = XMLAttribute = (function() {
00006 function XMLAttribute(parent, name, value) {
00007 this.options = parent.options;
00008 this.stringify = parent.stringify;
00009 if (name == null) {
00010 throw new Error("Missing attribute name of element " + parent.name);
00011 }
00012 if (value == null) {
00013 throw new Error("Missing attribute value for attribute " + name + " of element " + parent.name);
00014 }
00015 this.name = this.stringify.attName(name);
00016 this.value = this.stringify.attValue(value);
00017 }
00018
00019 XMLAttribute.prototype.clone = function() {
00020 return Object.create(this);
00021 };
00022
00023 XMLAttribute.prototype.toString = function(options) {
00024 return this.options.writer.set(options).attribute(this);
00025 };
00026
00027 return XMLAttribute;
00028
00029 })();
00030
00031 }).call(this);