XML records disappear from a lookup: check the namespace
You can see a record in an XML export, yet your extraction returns nothing. Before reporting that the source has no matching data, check how the element is named. The visible prefix before a colon is only part of the notation. A lookup that ignores its namespace can miss an element that is plainly present.
The repair is to match the intended namespace URI and local name together, then inspect the selected records. Do not remove all namespaces just to make the count increase: that can combine different vocabularies into one field.

Compare the name behind the prefix
In a:record, record is the local name. The applicable xmlns:a declaration supplies its namespace URI. W3C’s Namespaces in XML recommendation defines the resulting pair as an expanded name. Different prefixes can identify the same pair; a reused prefix can identify a different pair when its declaration changes.
For an evidence review, record that pair rather than treating the spelling a:record as a permanent identity. Check the declaration in scope at the element, including any nearer declaration inside the document. A namespace identifier is also not a certificate that the document came from a particular publisher.
Three visible records, two selected types
Invented exercise: save this short fragment as fixture.xml. The archive, identifiers and descriptions are fictional. This fragment demonstrates name matching; it is not a published archive schema.
<export xmlns:a="urn:example:archive:v1"
xmlns:b="urn:example:archive:v1"
xmlns:c="urn:example:archive:v2">
<a:record id="R-11">Pier map</a:record>
<b:record id="R-12">Lamp list</b:record>
<c:record id="R-13">Draft index</c:record>
</export>
| Record ID | Namespace URI | Local name | Select v1? |
|---|---|---|---|
| R-11 | urn:example:archive:v1 | record | Yes |
| R-12 | urn:example:archive:v1 | record | Yes |
| R-13 | urn:example:archive:v2 | record | No |
The first two elements have different prefixes but the same expanded name. The third has the same local name but a different namespace. Our selection rule asks only for the v1 type. Excluding R-13 under that rule does not make it invalid, obsolete or irrelevant; it belongs on a separate review row.
Make the extraction rule explicit
Python’s ElementTree namespace documentation describes its {uri}localname representation. For this tiny local fixture, a direct-child lookup can use that expanded name:
import xml.etree.ElementTree as ET
# fixture.xml contains only the invented fragment above.
root = ET.parse("fixture.xml").getroot()
print(len(root.findall("record"))) # 0
wanted = "{urn:example:archive:v1}record"
rows = root.findall(wanted)
print([row.get("id") for row in rows])
# ['R-11', 'R-12']
The first lookup asks for an unqualified element named record, so it finds zero. The second finds R-11 and R-12. A rule that discarded the namespace and kept only the local name would include R-13 too. These are three different selection rules, not three competing facts about how many elements the file contains.
We checked these results with the supplied fixture locally. No live archive was queried. The code is intentionally limited to direct children of this root; a differently nested export needs a path chosen from its actual structure. Do not turn findall returning zero into a claim about all descendants or about the publisher’s whole database.
No prefix does not always mean no namespace
This alternative element uses a default namespace:
<record xmlns="urn:example:archive:v1" id="R-11"/>
Its element name still belongs to v1. The unprefixed id attribute does not acquire that default namespace; this is why get("id") is appropriate here. The distinction is specified in W3C’s namespace-defaulting rules. It says nothing about whether a real export requires the attribute or considers its value unique.
Do not declare two whole documents equivalent merely because selected elements share an expanded name. Their values, attributes, order and other content may differ. Keep the received bytes, their source and collection time alongside the extraction output.
Leave a selection receipt
A useful note for this exercise is: “The file contains three direct child elements. The v1 record selector matched R-11 and R-12; the v2 record R-13 was retained separately.” Attach the selector, parser version and the original fragment so a colleague can reproduce the result.
For a real export, add its source reference and coverage limits to the evidence section of your report. If you move the results into a spreadsheet, use the CSV identifier-preservation guide to keep the extracted IDs intact. A successful parse and a correct record selection are different checks.
Author: OSINT Jet · Primary sources reviewed 28 November 2026
