How to parse atom/xml content with Javascript?



I am retrieving a Google Calendar Resource via their Data API, which returns the following content:



<?xml version="1.0" encoding="utf-8"?>
<atom:entry xmlns:atom="http://ift.tt/r5ut6F" xmlns:apps="http://ift.tt/1eat4Ig">
<apps:property name='resourceId' value='CR-NYC-14-12-BR'/>
<apps:property name='resourceCommonName' value='Boardroom'/>
<apps:property name='resourceDescription' value='Conference room in New York city, building 14, floor 12, Boardroom'/>
<apps:property name='resourceType' value='CR'/>
</atom:entry>


I need to get the value of one of the fields, such as resourceId and store it in a variable. How can I parse this and obtain that value? I am using Meteor JS on the server side, which uses JavaScript. Therefore, the answer needs to use JavaScript. Thank you!


No comments:

Post a Comment