dcarbone / php-fhir

Tools for consuming data from a FHIR server with PHP
Apache License 2.0
126 stars 40 forks source link

Add xmlns="http://hl7.org/fhir" upon XML serialization #92

Closed dennisverspuij closed 3 months ago

dennisverspuij commented 6 months ago

I would like that conform FHIR spec any XML serialization contains an xmlns="http://hl7.org/fhir", at least at the outer element. But it seems xmlSerialize() only adds an xmlns when manually set through method _getFHIRXMLNamespace(), or if it was unserialized from XML that contained such xmlns. But not upon construction of objects or unserializing from json. Why was it chosen not to set this default namespace, the constant PHPFHIR_FHIR_XMLNS is never used while generating classes? How can I best ensure serialized XML always contains xmlns="http://hl7.org/fhir" at the outer element? Thanks.

dcarbone commented 5 months ago

This is a known issue right now :(

I am working on a bigger update to supporting only PHP 8.1+, will be adding this to the list of features I want to enable!

dcarbone commented 4 months ago

Same underlying issue as #63

dcarbone commented 4 months ago

@dennisverspuij I've released v3.0.0, can you please check if it addresses this issue?