XML, YAML (YAML Ain't Markup Language) and CSV (comma-separated values): read the files tests depend on
Read file structure, then check exact values. A file that parses can still fail the app’s rules.
L1–L4 are part of the Pro pass
L0 Explain simply
Analogy: three kinds of forms. Tom tests Daily List, a made-up to-do app. One form has boxes inside boxes. Another uses indents to group entries. A third has rows and columns. Each form needs both a readable layout and the right answers.
XML (Extensible Markup Language) uses named tags around parts called elements. (YAML Ain't Markup Language) can use indents, but also has other styles. (comma-separated values) stores records made of fields. A field is one value. A record is one group of values.
Tom checks two things. Can a parser, a program that reads the format, read the file? Do the results meet the app’s rules? A task can have neat tags yet lack its required title. A name can look fine yet land in the wrong field.
He keeps the original file and a small safe test copy. He checks the loaded values before blaming the app.
Where the picture stops: a quoted CSV field can cross a line break. One visible line need not be one record. YAML does not always use indents. These forms are a memory aid, not the full rules.
PLAIN WORDS · 4 in this section
- indents
- spaces that push a line in from the left
- readable
- able to be read and understood, by people or software
- extensible
- able to be added to later
- parser
- a program that reads text and splits it into fields
PICTURE IT
The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.
THE REAL JOB Read each file with agreed settings, then check the app’s required structure and exact values.
- XML
- YAML
- CSV
HOW THE PICTURE MAPS
| In the picture | In the software |
|---|---|
| Boxes in boxes | XML elements, with paired or empty-element tags |
| Indents | YAML block style; flow style uses other marks |
| Rows and columns | CSV records and fields, which need not match visible lines |
| The clerk | The tester |
WHERE THIS PICTURE STOPS
- A quoted CSV field can span lines; one visible line need not be one record.
- YAML can use flow style, so indents are not its only structure marks.
- A parser reads syntax. The app still needs checks of shape, types and values.
HOOK
Read the format, then check the values.
TELL A FRIEND
Three forms need readable structure and the right answers.
OFTEN MIXED UP WITH Files, imports and exports. That topic covers imports and exports in general. This one reads three common file formats.
Sources & standards — 4 sources
- Official requirement
Extensible Markup Language (XML) 1.0, Fifth Edition ↗ — W3C · XML 1.0, Fifth Edition (26 November 2008), sections 2.1, 2.4 and 3.1: well-formed documents, escaped text and empty elements. Relevant primary passages opened 8 November 2026.
Primary page opened. Teaching is paraphrased. Synthetic examples are local test cases, not publisher product rules.
- Official requirement
YAML Ain’t Markup Language, revision 1.2.2 ↗ — YAML Language Development Team · YAML 1.2.2 (1 October 2021), sections 3.2.1, 3.2.3.1, 6.1, 7.3 and 10.3: unique keys, block/flow style, indentation, quoted text and core types. Relevant primary passages opened 8 November 2026.
Primary page opened. Teaching is paraphrased. Synthetic examples are local test cases, not publisher product rules.
- Market practice
RFC 4180: Common Format and MIME Type for CSV Files ↗ — IETF · RFC 4180 (October 2005), section 2: optional header, equal field counts, quoted commas and line breaks, doubled double quotes. Informational, not an Internet Standard. Relevant primary passages opened 8 November 2026.
Primary page opened. Teaching is paraphrased. Synthetic examples are local test cases, not publisher product rules.
- Market practice
Python 3.12: csv file reading and writing ↗ — Python Software Foundation · Python 3.12 csv documentation: reader returns strings, newline handling, dialect settings and line_num counting source lines rather than records. Relevant primary passages opened 8 November 2026.
Primary page opened. Teaching is paraphrased. Synthetic examples are local test cases, not publisher product rules.
PRACTISE AND KEEP
Sources for this topic — 11 sources
- Official requirement
Extensible Markup Language (XML) 1.0, Fifth Edition ↗ — W3C · XML 1.0, Fifth Edition (26 November 2008), sections 2.1, 2.4 and 3.1: well-formed documents, escaped text and empty elements. Relevant primary passages opened 8 November 2026.
Primary page opened. Teaching is paraphrased. Synthetic examples are local test cases, not publisher product rules.
- Official requirement
YAML Ain’t Markup Language, revision 1.2.2 ↗ — YAML Language Development Team · YAML 1.2.2 (1 October 2021), sections 3.2.1, 3.2.3.1, 6.1, 7.3 and 10.3: unique keys, block/flow style, indentation, quoted text and core types. Relevant primary passages opened 8 November 2026.
Primary page opened. Teaching is paraphrased. Synthetic examples are local test cases, not publisher product rules.
- Market practice
RFC 4180: Common Format and MIME Type for CSV Files ↗ — IETF · RFC 4180 (October 2005), section 2: optional header, equal field counts, quoted commas and line breaks, doubled double quotes. Informational, not an Internet Standard. Relevant primary passages opened 8 November 2026.
Primary page opened. Teaching is paraphrased. Synthetic examples are local test cases, not publisher product rules.
- Market practice
Python 3.12: csv file reading and writing ↗ — Python Software Foundation · Python 3.12 csv documentation: reader returns strings, newline handling, dialect settings and line_num counting source lines rather than records. Relevant primary passages opened 8 November 2026.
Primary page opened. Teaching is paraphrased. Synthetic examples are local test cases, not publisher product rules.
- Market practice
YAML specification changes: 1.1 to 1.2 ↗ — YAML Language Development Team · YAML specification changes: version 1.2 core types differ from version 1.1, including on/off and yes/no. Relevant primary passages opened 8 November 2026.
Primary page opened. Teaching is paraphrased. Synthetic examples are local test cases, not publisher product rules.
- Official requirement
Namespaces in XML 1.0, Third Edition ↗ — W3C · Namespaces in XML 1.0, Third Edition (8 December 2009), sections 2 and 6: expanded names and default namespaces. Relevant primary passages opened 8 November 2026.
Primary page opened. Teaching is paraphrased. Synthetic examples are local test cases, not publisher product rules.
- Market practice
XML External Entity Prevention Cheat Sheet ↗ — OWASP · OWASP XML External Entity Prevention: reject unneeded document type declarations, block external access and use parser-specific controls. Relevant primary passages opened 8 November 2026.
Primary page opened. Teaching is paraphrased. Synthetic examples are local test cases, not publisher product rules.
- Market practice
CSV Injection ↗ — OWASP · OWASP CSV Injection: spreadsheet formulas, limits of quoting and the need to test save/reopen behavior. Relevant primary passages opened 8 November 2026.
Primary page opened. Teaching is paraphrased. Synthetic examples are local test cases, not publisher product rules.
- Market practice
PyYAML documentation: safe loading ↗ — PyYAML maintainers · PyYAML documentation: safe_load accepts standard tags without constructing arbitrary Python objects. Relevant primary passages opened 8 November 2026.
Primary page opened. Teaching is paraphrased. Synthetic examples are local test cases, not publisher product rules.
- Market practice
yaml v2: parsing, schema and document options ↗ — Eemeli Aro · yaml v2 documentation: version/schema settings, uniqueKeys, parse errors and alias limits. Relevant primary passages opened 8 November 2026.
Primary page opened. Teaching is paraphrased. Synthetic examples are local test cases, not publisher product rules.
- Official requirement
Extensible Markup Language (XML) 1.0, Fifth Edition (26 November 2008) ↗ — W3C · XML 1.0 Fifth Edition sections 3 and 3.1: element start and end tags, empty-element form and attribute uniqueness, which define well-formed.
Opened relevant primary passages on6November2026 via normal web search and document view. Sections3 and3.1 opened: element start/end tags, empty-element form and attribute uniqueness.
Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.