TOPIC 40/6215 MINNOT STARTED

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.

  1. XML
  2. YAML
  3. CSV
Three forms

HOW THE PICTURE MAPS

How each part of the picture matches the software
In the pictureIn the software
Boxes in boxesXML elements, with paired or empty-element tags
IndentsYAML block style; flow style uses other marks
Rows and columnsCSV records and fields, which need not match visible lines
The clerkThe 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
  1. 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.

    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. · Checked 2026-11-08

    Primary page opened. Teaching is paraphrased. Synthetic examples are local test cases, not publisher product rules.

  2. 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.

    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. · Checked 2026-11-08

    Primary page opened. Teaching is paraphrased. Synthetic examples are local test cases, not publisher product rules.

  3. 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.

    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. · Checked 2026-11-08

    Primary page opened. Teaching is paraphrased. Synthetic examples are local test cases, not publisher product rules.

  4. 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.

    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. · Checked 2026-11-08

    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
  1. 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.

    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. · Checked 2026-11-08

    Primary page opened. Teaching is paraphrased. Synthetic examples are local test cases, not publisher product rules.

  2. 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.

    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. · Checked 2026-11-08

    Primary page opened. Teaching is paraphrased. Synthetic examples are local test cases, not publisher product rules.

  3. 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.

    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. · Checked 2026-11-08

    Primary page opened. Teaching is paraphrased. Synthetic examples are local test cases, not publisher product rules.

  4. 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.

    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. · Checked 2026-11-08

    Primary page opened. Teaching is paraphrased. Synthetic examples are local test cases, not publisher product rules.

  5. 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.

    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. · Checked 2026-11-08

    Primary page opened. Teaching is paraphrased. Synthetic examples are local test cases, not publisher product rules.

  6. 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.

    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. · Checked 2026-11-08

    Primary page opened. Teaching is paraphrased. Synthetic examples are local test cases, not publisher product rules.

  7. 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.

    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. · Checked 2026-11-08

    Primary page opened. Teaching is paraphrased. Synthetic examples are local test cases, not publisher product rules.

  8. 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.

    OWASP CSV Injection: spreadsheet formulas, limits of quoting and the need to test save/reopen behavior. Relevant primary passages opened 8 November 2026. · Checked 2026-11-08

    Primary page opened. Teaching is paraphrased. Synthetic examples are local test cases, not publisher product rules.

  9. 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.

    PyYAML documentation: safe_load accepts standard tags without constructing arbitrary Python objects. Relevant primary passages opened 8 November 2026. · Checked 2026-11-08

    Primary page opened. Teaching is paraphrased. Synthetic examples are local test cases, not publisher product rules.

  10. 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.

    yaml v2 documentation: version/schema settings, uniqueKeys, parse errors and alias limits. Relevant primary passages opened 8 November 2026. · Checked 2026-11-08

    Primary page opened. Teaching is paraphrased. Synthetic examples are local test cases, not publisher product rules.

  11. 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.

    Sections3 and3.1 opened: element start/end tags, empty-element form and attribute uniqueness. · Checked 2026-11-06

    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.