Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XML Serialization VS XML Parsing

What is the difference between XML Serialization and XML Parsing? When should we use each one?

like image 564
Java P Avatar asked Aug 15 '12 07:08

Java P


People also ask

What is the difference between parsing and serialization?

Parsing is the process of analyzing some string of symbols. Serialising is the process of transforming an object into a format that can be stored.

What is XML serialization?

XML serialization is the process of converting XML data from its representation in the XQuery and XPath data model, which is the hierarchical format it has in a Db2® database, to the serialized string format that it has in an application.

What are the two types of XML parser?

In PHP there are two major types of XML parsers: Tree-Based Parsers. Event-Based Parsers.

What is parsing an XML?

Definition. XML parsing is the process of reading an XML document and providing an interface to the user application for accessing the document. An XML parser is a software apparatus that accomplishes such tasks.


1 Answers

Parsing is, generally speaking, the processing of an input stream into meaningful data structures; in the XML context, parsing is the process of reading a sequence of characters conforming to the grammar and other constraints of the XML spec into whatever internal representation of XML your program uses.

Serialization is the opposite process: processing the internal data structures of a program (in this context, your internal representation of an XML document) and creating a character sequence (typically written to an output stream) that conforms to the angle-bracket syntax of the spec.

Use a parser to read XML from a character stream into data structures; use a serializer to write data structures out into a character stream.

like image 86
C. M. Sperberg-McQueen Avatar answered Dec 11 '22 17:12

C. M. Sperberg-McQueen