{"action":"created","issue":{"url":"https://api.github.com/repos/michaelkourlas/node-js2xmlparser/issues/25","labels_url":"https://api.github.com/repos/michaelkourlas/node-js2xmlparser/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/michaelkourlas/node-js2xmlparser/issues/25/comments","events_url":"https://api.github.com/repos/michaelkourlas/node-js2xmlparser/issues/25/events","html_url":"https://github.com/michaelkourlas/node-js2xmlparser/issues/25","id":61673858,"number":25,"title":"Preserve Array Information","user":{"login":"martinib77","id":5649614,"avatar_url":"https://avatars.githubusercontent.com/u/5649614?v=3","gravatar_id":"","url":"https://api.github.com/users/martinib77","html_url":"https://github.com/martinib77","followers_url":"https://api.github.com/users/martinib77/followers","following_url":"https://api.github.com/users/martinib77/following{/other_user}","gists_url":"https://api.github.com/users/martinib77/gists{/gist_id}","starred_url":"https://api.github.com/users/martinib77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinib77/subscriptions","organizations_url":"https://api.github.com/users/martinib77/orgs","repos_url":"https://api.github.com/users/martinib77/repos","events_url":"https://api.github.com/users/martinib77/events{/privacy}","received_events_url":"https://api.github.com/users/martinib77/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-14T18:37:08Z","updated_at":"2015-03-14T21:31:48Z","closed_at":null,"body":"When transforming an array to xml, the library repeats each array object with the same tag.\r\nIf the array has only one element, we lost the information about the original object, been an array.\r\nExample\r\n```json\r\n    people: [{\"name\":\"martin\"}];\r\n```\r\ntranslates to:\r\n ```xml\r\n   <people>\r\n       <name>martin</name>\r\n    </people>\r\n```\r\nLooking at the xml, we don't know that the original object was an array.\r\n\r\nI did some changes to create an structure like this:\r\n ```xml\r\n<arrayPeople>\r\n     <people>\r\n         <name>martin</name>\r\n     </people>\r\n </arrayPeople>\r\n ```\r\n\r\nIt adds en element with \"array\" prefix.\r\nWhat do you think of this?\r\n\r\nRegards,\r\n"},"comment":{"url":"https://api.github.com/repos/michaelkourlas/node-js2xmlparser/issues/comments/80726246","html_url":"https://github.com/michaelkourlas/node-js2xmlparser/issues/25#issuecomment-80726246","issue_url":"https://api.github.com/repos/michaelkourlas/node-js2xmlparser/issues/25","id":80726246,"user":{"login":"martinib77","id":5649614,"avatar_url":"https://avatars.githubusercontent.com/u/5649614?v=3","gravatar_id":"","url":"https://api.github.com/users/martinib77","html_url":"https://github.com/martinib77","followers_url":"https://api.github.com/users/martinib77/followers","following_url":"https://api.github.com/users/martinib77/following{/other_user}","gists_url":"https://api.github.com/users/martinib77/gists{/gist_id}","starred_url":"https://api.github.com/users/martinib77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinib77/subscriptions","organizations_url":"https://api.github.com/users/martinib77/orgs","repos_url":"https://api.github.com/users/martinib77/repos","events_url":"https://api.github.com/users/martinib77/events{/privacy}","received_events_url":"https://api.github.com/users/martinib77/received_events","type":"User","site_admin":false},"created_at":"2015-03-14T21:31:48Z","updated_at":"2015-03-14T21:31:48Z","body":"Idea number 2,\r\nadd an \"index\" attribute for array elements,\r\nso the result will be:\r\n```xml\r\n<people index=\"0\">\r\n   <name>martin</name>\r\n</people>\r\n```\r\n\r\nIf you agree i'll make a pull request with this change."}}