COB logoCOB honor code logo

 

BA372 — XML/JSON Lab

 

 

  • Now we have an idea of how to read and parse XML files, let us read and parse a 'real' one from the web; i.e., one from Google's on-line location services.
  •  

  • Serialization: XML-OO transforms:
  • Next, we will go in the opposite direction (deserialization):

    <?xml version="1.0" encoding="utf-16"?>
    <Person xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <cName>
        <first_name>Mary</first_name>
        <last_name>Hurst</last_name>
      </cName>
      <cAge>50</cAge>
      <cProfession>dentist</cProfession>
    </Person>

     

  • New(er) development: JSON (JavaScript Object Notation):