XML and Object Serialization. Structure of an XML Document Header Root Element Start Tags / End Tags...

5
XML and Object Serialization

Transcript of XML and Object Serialization. Structure of an XML Document Header Root Element Start Tags / End Tags...

Page 1: XML and Object Serialization. Structure of an XML Document Header Root Element Start Tags / End Tags Element Contents – Child Elements – Text – Both (mixed.

XML and Object Serialization

Page 2: XML and Object Serialization. Structure of an XML Document Header Root Element Start Tags / End Tags Element Contents – Child Elements – Text – Both (mixed.

Structure of an XML Document

• Header• Root Element• Start Tags / End Tags• Element Contents– Child Elements– Text– Both (mixed contents)

• Element Attributes• Comments• Entity References

Page 3: XML and Object Serialization. Structure of an XML Document Header Root Element Start Tags / End Tags Element Contents – Child Elements – Text – Both (mixed.

Parsing / Searching XML Documents

• StAX Parser– XMLStreamReader– Example

• DOM Parser– Document Object Model (DOM)– Example

• Searching DOM with XPath– Example

Page 4: XML and Object Serialization. Structure of an XML Document Header Root Element Start Tags / End Tags Element Contents – Child Elements – Text – Both (mixed.

Creating XML Documents

• StAX– Example

• DOM– Example

Page 5: XML and Object Serialization. Structure of an XML Document Header Root Element Start Tags / End Tags Element Contents – Child Elements – Text – Both (mixed.

Object Serialization

• Java binary serialization– Example

• XML– XStream Example

• JSON– XStream Example