Closed dexter1023 closed 5 years ago
Can you post your code please?
For anyone wondering, this happens when you try to add an attribute to the document instead of an element. Example:
builder.create({
root: {
child: 'value'
},
'@attr': 'value'
});
Uncaught TypeError TypeError: this.attribute is not a function
Instead of
builder.create({
root: {
child: 'value',
'@attr': 'value', // root attr, not childs
},
});
<root attr="value"><child>value</child></root>
Hi, I've got that error while create xml document from object:
TypeError: this.attribute is not a function at XMLDocument.element (/node_modules/xmlbuilder/lib/XMLNode.js:131:32)
I checked code and there's no implementation of function "attribute".