-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
Right now this module expect attributes to be string primitives.
I'd expect numbers to be automatically converted to strings if necessary. There is also a common practice how to handle boolean and non-existent attributes (see below).
// this fails, expected: <element test="123">
xml.startElement('element').writeAttribute('test', 123)
// this fails, expected: <element test="123">
xml.startElement('element').writeAttribute('test', new String('123'))
// this fails, expected: <element test="test">
xml.startElement('element').writeAttribute('test', true)
// this fails, expected: <element>
xml.startElement('element').writeAttribute('test', false)
// this fails, expected: <element>
xml.startElement('element').writeAttribute('test', null)
// this fails, expected: <element>
xml.startElement('element').writeAttribute('test', undefined)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels