Stream: implementers
Topic: xml namespace prefixes
Patrick Werner (Feb 28 2022 at 15:56):
I tried to find some definitions/rules about prefix namespaces for fhir. I'm involved in a project where one implementer sends fhir xml with a namespace prefix of fhir: e.g.<fhir:identifier>
Patrick Werner (Feb 28 2022 at 15:57):
this breaks a lot of the FHIR tooling (validation), and i was wondering where this prefixing is forbidden in the FHIR spec, or if it is it allowed?
Gino Canessa (Feb 28 2022 at 16:07):
I will preface this with the fact that I have been actively avoiding XML as much as possible for the past several years. Perhaps @John Moehrke has a more authoritative response =).
That said, I think it is prohibited? The xml page states:
FHIR elements are always in the namespace http://hl7.org/fhir . This is usually specified as the default namespace on the root element. The only other namespace that occurs in FHIR resources is the XHTML namespace - XHTML is found in most resources
Looking at format spec at the top of the page, the xmlns
is fixed text as well, so I would lean towards that being required.
Lloyd McKenzie (Feb 28 2022 at 16:09):
Namespace prefixes shouldn't matter at all. All that should matter is the namespace URL. What validation issues are you hitting?
Patrick Werner (Feb 28 2022 at 16:11):
Will have to ask about the concrete issues, will update here.
Patrick Werner (Feb 28 2022 at 16:13):
Gino Canessa said:
I will preface this with the fact that I have been actively avoiding XML as much as possible for the past several years. Perhaps John Moehrke has a more authoritative response =).
That said, I think it is prohibited? The xml page states:
FHIR elements are always in the namespace http://hl7.org/fhir . This is usually specified as the default namespace on the root element. The only other namespace that occurs in FHIR resources is the XHTML namespace - XHTML is found in most resources
Looking at format spec at the top of the page, the
xmlns
is fixed text as well, so I would lean towards that being required.
I thought so too. But there is no statement against having a prefix on the default namespace.
Last updated: Apr 12 2022 at 19:14 UTC