5 module.exports = XMLAttribute = (
function() {
6 function XMLAttribute(parent, name, value) {
7 this.options = parent.options;
8 this.stringify = parent.stringify;
10 throw new Error(
"Missing attribute name of element " + parent.name);
13 throw new Error(
"Missing attribute value for attribute " + name +
" of element " + parent.name);
15 this.name = this.stringify.attName(name);
16 this.value = this.stringify.attValue(value);
19 XMLAttribute.prototype.clone =
function() {
20 return Object.create(
this);
23 XMLAttribute.prototype.toString =
function(options) {
24 return this.options.writer.set(options).attribute(
this);