CSV ToolsLesson 354Free preview
CSV to XML
This lesson is part of Web Developer Tools · All levels
Summary
CSV to XML converts the table data into XML documents that have hierarchical structures. Each row of CSV is usually a single element of the record, while the column name is the name of the element or attribute in it. Conversion needs to handle specific character escaping and normalize the name of the element to keep the XML document valid.
Key points
- XML has a single root element that wraps up the entire content.
- Each row of CSV is generally mapped to a single record element
- The characters & and < must be escaped within XML text
- The name of the element must not be preceded by a number or contain spaces
- XML documents can be validated with XSD or XML parser
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.