xml and object serialization. structure of an xml document header root element start tags / end tags...

5
XML and Object Serialization

Upload: nathaniel-ward

Post on 18-Jan-2016

217 views

Category:

Documents


0 download

TRANSCRIPT

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