Pranav P

Pranav P

  • 1.9k
  • 45
  • 353

reading xml document as attribute name and attirbute value

Jun 28 2019 5:11 AM
 from the given piece of  xml document
<book category="COOKING">
<title >Everyday Italian</title>
<author>Giada De Laurentiis</author>
<book category="CHILDREN">
<title>Harry Potter</title>
<author>J K. Rowling</author>
how to read the attributes names and their values  from an xml document as the given format below
{category:'COOKING',title:'Everyday Italian',author: 'Giada De Laurentiis',year: '2005',price:'30.00'}
{category:'CHILDREN',title:'Harry Potter',author: 'J K. Rowling',year: '2005',price:'29.99'} 
is there any sample code that i can refer ?
thanks in advance. 

Brought to you by:

Answers (3)