-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
I'm trying a single example structure (which contains $$hashKey as added by AngularJS during edit) and x2js.json2xml_str is producing a <$$hashKey>030</$$hashKey> node, which then the parser chokes on.
The end effect is that x2js.json2xml(myVar) is always null.
I would expect an exception not a null, but in this case I guess $-prefixed properties should simply be skipped, as they are both reserved in AngularJS and invalid XML tag names anyways.
Right now I'm doing this:
function removeDollars(obj) {
if (typeof obj != 'object')
return;
for (var k in obj) {
if (k.charAt(0) == '$')
delete obj[k];
removeDollars(obj[k]);
}
}
var data = angular.copy($scope.value);
removeDollars(data);
var xml = x2js.json2xml_str(data);Metadata
Metadata
Assignees
Labels
No labels