Skip to content

Language record

XML

XML is read as the element tree it declares: every element is a symbol contained by its parent, every attribute is a property, and an attribute value that names a declared type — `type=`, `ref=`, `base=` — becomes a reference whose metadata says whether it resolves inside this document, against a built-in, or outside.

.xml, .xsd, .dtd, .svg, .xsl, .xslt, .rng · 1 registry id · 9 of 14 relationship types

The registry row this page is generated from

Read at render time from the same family row the register reads, so nothing in this block can disagree with it.

Extensions
.xml, .xsd, .dtd, .svg, .xsl, .xslt, .rng
Registry names
xml
Recorded symbols
elements · namespaces · attributes

Relationship types this analyzer constructs

9 of 14 constructed, read from this analyzer's source and re-derived by the languages gate. Each row below is one of the engine's types, in the engine's own order.

Relationship typeConstructed
callsconstructed by this analyzer
extendsconstructed by this analyzer
implementsruled absent
usesconstructed by this analyzer
importsconstructed by this analyzer
exportsruled absent
containsconstructed by this analyzer
referencesconstructed by this analyzer
overridesconstructed by this analyzer
instantiatesruled absent
decoratesruled absent
rendersruled absent
mixes_inconstructed by this analyzer
part_ofconstructed by this analyzer

9 constructed, 5 not constructed. All 5 absent types are recorded as ruled absent: the written reason and the corpus measurement behind each are in this family's completeness record. The register explains what each label means.

What this analyzer does not resolve

  • An attribute value is a string, and only some of them are references. A prefixed value is one wherever it appears; an unprefixed value counts only on one of ten attributes the analyzer names — type, base, ref, itemType, memberTypes, substitutionGroup, refer, portType, binding, pattern — so use="optional" and maxOccurs="unbounded" produce no edge. That table came from a census of the corpus: 9,391 bare key= property names, 4,453 use= values and 1,404 maxOccurs= values that are plainly not type references.
  • An element is named by its name= attribute only inside four vocabularies — 42 local names across XSD, RelaxNG, XSLT and WSDL. Outside them the tag is the identity, because 29,196 elements in the corpus carry a name attribute and nearly all of them are data; a rule keyed on the attribute alone once published a symbol named xml for <xsl:output method="xml"/>.
  • Exactly five entity names are predefined — &lt;, &gt;, &amp;, &apos;, &quot;. &nbsp; and &mdash; are not, so the corpus's 4,370 &d; sites and 1,381 &nbsp; sites stay unresolved unless the document declares them. That is what the specification says, and it is stated here because anyone arriving from HTML expects otherwise.

Every line above was written against XML’s own analyzer module and is named against a construct in it, so it can be checked against the source. Nothing here is inherited from a template, or from another language’s page.

Where you meet it in a repository

Recognised by extension — .xml, .xsd, .dtd, .svg, .xsl, .xslt, .rng. Everything below is about where those files actually sit in a working repository.

  • An XSD, a WSDL, a Spring or Maven descriptor and a Maven pom.xml are all XML, and the last two rely heavily on namespace prefixes to mean anything — which is exactly the shape the prefixed-value rule was built for. Namespace bindings are scoped, so an xmlns:p on one element does not resolve a prefix on its sibling.
  • Every element is a symbol, so a large generated XML file publishes a very large tree. The address that helps is the containment path — config > services > service — rather than a flat list of tags, and there is no way to ask for only the leaves.
  • A DTD brings a second vocabulary: doctype declarations, element and attribute declarations, entities and notations are recorded with their own roles, and a content-model member that no declaration in the file names gets a shadow target published for it rather than a dangling containment edge.

Questions this index answers

Phrased as retrievals, because that is what an index can honestly do: it holds the symbols and the edges between them, and hands them back with the evidence attached.

  1. Which elements does this document declare, and how are they nested?
  2. Which attributes does this element carry?
  3. Which types does this schema reference, and do they resolve here?
  4. Which namespace prefix does this document bind, and where?

What the analyzer sees in code like this

A namespaced element, its attribute, and a reference whose resolution is recorded
<config xmlns:db="urn:acme:db">        <!-- bb records: element config -->
  <db:pool size="8">                    <!-- bb records: element pool under db, property size -->
    <entry ref="urn:acme:Invoice"/>      <!-- bb records: a reference: prefixed value on ref -->
  </db:pool>
</config>

Symbols are stored with the file they came from and the bytes they span, so a hit points at a line rather than at a guess. The annotations in the sample are commentary for the reader, not strings the index would store.

Languages that turn up in the same repository

Web, data & config — the count beside each name is how many relationship types that family’s analyzer constructs.

The extensions, registry names, recorded symbols and relationship types above are the parser registry row for XML, read while the page rendered — the same row the register reads, so the two surfaces cannot tell two stories. Every relationship type listed as constructed appears in src/ast/real-*, the analyzer modules bb ships. bb 0.1.0 answers from a local store over 50 languages (53 registry ids, three of them aliases). There is no benchmark on this page: every claim here is one you can go and read in the source.