SI Store Ops

Inspectable example · updated 2026-10-11

Synthetic XML feed cases: five first errors a parser reports and one well-formed file that loses fields

Invented XML snippets with the first error a standard parser reports for each, plus a well-formed namespaced item with CDATA that a text-matching importer misreads.

An example, not a customer case study. Scope and evidence limitations are described below.

The invented snippets and their first errors

This is a synthetic worked example with invented values, not a customer case or a supplier's file. Results marked computed were produced with Python's standard library on invented input. Each snippet is two or three lines. The messages below were produced by Python's built-in XML parser; other parsers word them differently, but the position of the first error is the useful part.

If the matrix is wider than the box, scroll horizontally to read every column. Keyboard: focus the matrix and use Left/Right.

case                         first error reported
unescaped ampersand           not well-formed (invalid token): line 2, column 18
  <item><name>Nuts & Bolts</name></item>
closing tag in a different case   mismatched tag: line 2, column 19
  <item><Name>Hinge</name></item>
control character (U+000B)    not well-formed (invalid token): line 2, column 17
text after the root element   junk after document element: line 4, column 0
bytes not valid in declared UTF-8   not well-formed (invalid token): line 2, column 15
  (declared utf-8; file bytes were Latin-1)

A well-formed file that still loses fields

The file below parses without error. The price lives in the Google namespace, and the name is a CDATA section whose text looks like markup and contains an ampersand. A text-matching importer looking for a plain price tag finds none and stores the name with its angle brackets treated as tags. A real parser with the namespace declared returns the price 4.20 GBP and the name Hinge <brass> & steel, as computed.

If the matrix is wider than the box, scroll horizontally to read every column. Keyboard: focus the matrix and use Left/Right.

<feed xmlns:g="http://base.google.com/ns/1.0">
<item><g:price>4.20 GBP</g:price>
<name><![CDATA[Hinge <brass> & steel]]></name></item>
</feed>

parser result: {g}price = '4.20 GBP'; name = 'Hinge <brass> & steel'

The assertions an importer test should make

Assert that the well-formed file stores both values exactly. Assert that each broken snippet is rejected as a whole, with the line and column of its first error in the message, and that the stored products are identical before and after the attempt. Assert that a document declaring an entity or an external resource is refused or left unexpanded, because Python's documentation warns that attacker-controlled XML can exhaust memory through entity expansion. These are authored expectations; no supplier's feed was read.

What this example does not show

It does not show how any supplier produces its XML, nor does it repair a broken file. A file that is not well-formed is the supplier's to correct; the specification treats it as a fatal error, and repairing it by text substitution can store wrong products.

Use it to specify a priced enquiry

If your importer fails one of these, the fixed job xml-supplier-feed-parse-errors-import is £295 for one importer path and one named supplier layout. Send a redacted sample and the exact parse message first, never real price lists, credentials or code. Prices are untested proposals, and payment follows the agreed checks and your sign-off. Nothing is booked or charged by an enquiry.

Sources and limits

  • W3C Extensible Markup Language (XML) 1.0, Fifth Edition Checked 2026-10-11.
    • A well-formedness violation is a fatal error that a processor must report; literal < and & must be escaped outside CDATA, comments and processing instructions; end-tag names must match exactly with no case folding; a document has one root element.
  • Python xml documentation Checked 2026-10-11.
    • Attacker-controlled XML can be used for denial of service through entity expansion and compressed bombs.