This page is part of the FHIR Specification (v0.5.0: DSTU 2 Ballot 2). The current version which supercedes this version is 5.0.0. For a full list of available versions, see the Directory of published versions
. Page versions: R5 R4B R4 R3 R2

The XML representation for a resource is described using this format:
<name xmlns="http://hl7.org/fhir" (attrA="value")><nameA><!--
1..1 type description of content --><nameA> <nameB[x]><!-- 0..1 type1|type1 description --></nameB> <nameC> <!-- 1..* --> <nameD><!-- 1..1 type>Relevant elements --></nameD> </nameC> <name>
Using this format:
) denotes that an element defines or is affected by additional rules that control its presence and/or content
This specification provides schema definitions for all of the content models it describes.
The base schema is called "fhir-base.xsd" and defines all of the datatypes and base infrastructure types. In addition, there is a schema for each resource and a common schema fhir-all.xsd that includes all the resource schemas. For schema processors that do not like circular includes, there is a single schema that contains everything.
In addition to the w3c schema files, this specification also provides Schematron files that enforce the various constraints defined for the datatypes and resources. These are packaged as files for each resource.
XML that is exchanged SHALL be valid against the w3c schema and Schematron, though being valid against the schema and Schematron is not sufficient to be a conformant instance: this specification makes several rules that cannot be checked by either mechanism. Operational systems may choose to use schema tools to check validation, but are not required to do so. Exchanged content SHALL not specify the schema or even contain the schema instance namespace in the resource itself.

Resources and/or Bundles may be digitally signed (ref to be provided). One consequence of signing the document is that URLs, identifiers and internal references are frozen and cannot be changed. This might be a desired feature, but it may also cripple interoperability between closed ecosystems where re-identification frequently occurs. For this reason, it is recommended that only Document Bundles are signed and then only when all the related resources are found in the bundle.
todo: canonical XML