Stream: hapi
Topic: XML 1.1
Michael Lawley (Mar 16 2020 at 21:25):
Hi @James Agnew , I see you're doing a bunch of work on the validator code at the moment. I've just run into an issue where the character turns up in a CodeSystem. This is illegal in XML 1.0 but ok in XML 1.1. Unfortunately, FhirValidator.validateWithResult
(HAPI 4.2.0) uses XML 1.0 when it serialises to XML (XmlParser.doEncodeResourceToWriter
) which then fails.
James Agnew (Mar 17 2020 at 14:43):
Hmm.. @Michael Lawley any idea how I could replicate this problem?
Michael Lawley (Mar 17 2020 at 14:50):
If you parse the following and pass it to FhirValidator.validateWithResult
with just the Schema validator enabled, then that should trigger it.
<?xml version="1.1" encoding="UTF-8"?> <Parameters xmlns="http://hl7.org/fhir"> <parameter> <name value="bug"/> <valueString value="Example, problem character."/> </parameter> </Parameters>
Grahame Grieve (Mar 17 2020 at 18:39):
it should be
James Agnew (Mar 17 2020 at 20:30):
oh interesting.... do people still use the schema validator much? i assumed not.. i've been vaguely pondering whether to deprecate it in HAPI, given how much better the instance validator is
James Agnew (Mar 17 2020 at 20:30):
(not that i disagree with fixing this.. just wondering)
Grahame Grieve (Mar 17 2020 at 20:45):
I'm not sure that the schema validator picks this up. the instance validator will from now on
Michael Lawley (Mar 18 2020 at 14:03):
We have two paths for validation. "Full" validation and "fast" validation. I've been working on the, unmeasured but observed, notion that schema validation is much faster and "good enough" to ensure that egregious errors will be handled before we start attempting to handle $expand semantics etc.
It's been on my list to circle back and validate (rimshot) this assumption, but I've been delaying as I'm aware there are changes coming down the pipeline (and now I've just read your HAPI 5 post, so I'm super super excited)
Grahame Grieve (Mar 18 2020 at 19:54):
I'm interested in metrics. making the validator faster is of interest
Last updated: Apr 12 2022 at 19:14 UTC