{"action":"created","issue":{"url":"https://api.github.com/repos/eye3/nkit4nodejs/issues/2","repository_url":"https://api.github.com/repos/eye3/nkit4nodejs","labels_url":"https://api.github.com/repos/eye3/nkit4nodejs/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/eye3/nkit4nodejs/issues/2/comments","events_url":"https://api.github.com/repos/eye3/nkit4nodejs/issues/2/events","html_url":"https://github.com/eye3/nkit4nodejs/issues/2","id":154881677,"number":2,"title":"How to map fields with fieldname as attribute","user":{"login":"evallgar","id":10398339,"avatar_url":"https://avatars.githubusercontent.com/u/10398339?v=3","gravatar_id":"","url":"https://api.github.com/users/evallgar","html_url":"https://github.com/evallgar","followers_url":"https://api.github.com/users/evallgar/followers","following_url":"https://api.github.com/users/evallgar/following{/other_user}","gists_url":"https://api.github.com/users/evallgar/gists{/gist_id}","starred_url":"https://api.github.com/users/evallgar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evallgar/subscriptions","organizations_url":"https://api.github.com/users/evallgar/orgs","repos_url":"https://api.github.com/users/evallgar/repos","events_url":"https://api.github.com/users/evallgar/events{/privacy}","received_events_url":"https://api.github.com/users/evallgar/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2016-05-14T23:51:24Z","updated_at":"2016-05-16T07:23:27Z","closed_at":"2016-05-16T07:23:27Z","body":"Hi,\r\n\r\nI have an XML doc that looks like this:\r\n\r\n**This is what I have**\r\n````xml\r\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n    <GTSResponse>\r\n        <Record>\r\n            <Field name=\"TITLE\">Empire Burlesque</Field>\r\n            <Field name=\"ARTIST\">Bob Dylan</Field>\r\n            <Field name=\"COUNTRY\">USA</Field>\r\n            <Field name=\"COMPANY\">Columbia</Field>\r\n            <Field name=\"PRICE\">10.90</Field>\r\n            <Field name=\"YEAR\">1985</Field>\r\n        </Record>\r\n        <Record>\r\n            <Field name=\"TITLE\">Hide your heart</Field>\r\n            <Field name=\"ARTIST\">Bonnie Tyler</Field>\r\n            <Field name=\"COUNTRY\">UK</Field>\r\n            <Field name=\"COMPANY\">CBS Records</Field>\r\n            <Field name=\"PRICE\">9.90</Field>\r\n            <Field name=\"YEAR\">1988</Field>\r\n        </Record>\r\n    </GTSResponse>\r\n````\r\n\r\n**This is what I need**\r\n````json\r\n{ records: [ { \"TITLE\":\"Empire Burlesque\", \"ARTIST\":\"Bob Dylan\", \"COUNTRY\":\"USA\", \"COMPANY\":\"Columbia\",\"PRICE\":\"10.90\", \"YEAR\":\"1985\"},{\"TITLE\":\"Hide your heart\", \"ARTIST\":\"Bonnie Tyler\", \"COUNTRY\":\"UK\", \"COMPANY\":\"CBS Records\",\"PRICE\":\"9.90\",\"YEAR\":\"1988\"} ] }\r\n````\r\n\r\n**This is what I'm getting right now**\r\n````js\r\n[ [ { field: 'Empire Burlesque' },\r\n    { field: 'Bob Dylan' },\r\n    { field: 'USA' },\r\n    { field: 'Columbia' },\r\n    { field: '10.90' },\r\n    { field: '1985' } ],\r\n  [ { field: 'Hide your heart' },\r\n    { field: 'Bonnie Tyler' },\r\n    { field: 'UK' },\r\n    { field: 'CBS Records' },\r\n    { field: '9.90' },\r\n    { field: '1988' } ] ]\r\n````\r\n\r\n**This is how i'm getting it**\r\n````js\r\nmapping = [\"/Record\", [\"/Field\", {\"/ -> field\": \"string\"} ]];\r\n````\r\n\r\nWhat do I need to do to get what I need? Hope you can help me achieve it ... thanks!"},"comment":{"url":"https://api.github.com/repos/eye3/nkit4nodejs/issues/comments/219365100","html_url":"https://github.com/eye3/nkit4nodejs/issues/2#issuecomment-219365100","issue_url":"https://api.github.com/repos/eye3/nkit4nodejs/issues/2","id":219365100,"user":{"login":"eye3","id":8004684,"avatar_url":"https://avatars.githubusercontent.com/u/8004684?v=3","gravatar_id":"","url":"https://api.github.com/users/eye3","html_url":"https://github.com/eye3","followers_url":"https://api.github.com/users/eye3/followers","following_url":"https://api.github.com/users/eye3/following{/other_user}","gists_url":"https://api.github.com/users/eye3/gists{/gist_id}","starred_url":"https://api.github.com/users/eye3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eye3/subscriptions","organizations_url":"https://api.github.com/users/eye3/orgs","repos_url":"https://api.github.com/users/eye3/repos","events_url":"https://api.github.com/users/eye3/events{/privacy}","received_events_url":"https://api.github.com/users/eye3/received_events","type":"User","site_admin":false},"created_at":"2016-05-16T07:23:26Z","updated_at":"2016-05-16T07:23:26Z","body":"I'm happy for you. Good luck!"}}