I'm wondering what is the difference between data parsing and transformation.
For example, if I need to convert data from XML format to JSON format will it be a transformation or parsing?
Transformation is a mapping from one form to another.
Parsing is an analysis of a sequential form to identify structural parts.
Data conversion is fundamentally a transformation. Note, though, that transformations often leverage structure identified during parsing of the input form to create the output form.
Parsing technically is the process of establishing the logical structure of the textual input: for example establishing that <a b="3"/> represents an element named a containing an attribute named b whose value is 3.
Unfortunately the term seems to be increasingly misunderstood, and programmers without formal computer science training often misuse the term to mean almost any processing of the parsed data: we see questions on SO saying "I am writing a parser", when actually they are writing an application that consumes the output of a parser.
Converting XML to JSON is a three-stage process: parsing the XML, transforming the resulting data structure to a different data structure, and then serializing the transformed data structure into JSON syntax.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With