-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
It doesn't seems that namespaces are supported :
When using 'fromXML' the properties within another namespace are not extracted :
let template = parse(`<persons>
<person xmlns:c="https://github.com/wspringer/cruftless" xmlns:t="https://github.com/test" c:bind="persons|array">
<name>{{name|required}}</name>
<t:age>{{age|integer|required}}</t:age>
</person>
</persons>`);
xml = template.toXML({
persons: [
{ name: "John Doe", age: 16 },
{ name: "Jane Doe", age: 18 },
],
})
console.log(xml); // OK : <persons><person xmlns:t="https://github.com/test"><name>John Doe</name><t:age>16</t:age></person><person xmlns:t="https://github.com/test"><name>Jane Doe</name><t:age>18</t:age></person></persons>
console.log(template.fromXML(xml)); // NOK : age is not extracted ({ persons: [ { name: 'John Doe' }, { name: 'Jane Doe' } ] })
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels