mirror of
https://github.com/hapifhir/org.hl7.fhir.core.git
synced 2025-03-09 14:31:17 +00:00
fixes for snapshot generation test debugging
This commit is contained in:
parent
023d87ad20
commit
a3804bab47
@ -57,14 +57,14 @@ public class XVersionLoader {
|
||||
|
||||
public static void saveXml(String version, Resource resource, OutputStream stream) throws FHIRFormatError, IOException {
|
||||
if (Utilities.noString(version)) {
|
||||
new org.hl7.fhir.r5.formats.XmlParser().compose(stream, resource, true);
|
||||
new org.hl7.fhir.r5.formats.XmlParser().setOutputStyle(OutputStyle.PRETTY).compose(stream, resource);
|
||||
}
|
||||
switch (VersionUtilities.getMajMin(version)) {
|
||||
case "1.0":
|
||||
new org.hl7.fhir.dstu2.formats.XmlParser().compose(stream, VersionConvertorFactory_10_50.convertResource(resource), true);
|
||||
return;
|
||||
case "1.4":
|
||||
new org.hl7.fhir.dstu2016may.formats.XmlParser().compose(stream, VersionConvertorFactory_14_50.convertResource(resource), true);
|
||||
new org.hl7.fhir.dstu2016may.formats.XmlParser(true, true).compose(stream, VersionConvertorFactory_14_50.convertResource(resource), true);
|
||||
return;
|
||||
case "3.0":
|
||||
new org.hl7.fhir.dstu3.formats.XmlParser().compose(stream, VersionConvertorFactory_30_50.convertResource(resource), true);
|
||||
@ -73,7 +73,7 @@ public class XVersionLoader {
|
||||
new org.hl7.fhir.r4.formats.XmlParser().compose(stream, VersionConvertorFactory_40_50.convertResource(resource), true);
|
||||
return;
|
||||
case "5.0":
|
||||
new org.hl7.fhir.r5.formats.XmlParser().compose(stream, resource, true);
|
||||
new org.hl7.fhir.r5.formats.XmlParser().setOutputStyle(OutputStyle.PRETTY).compose(stream, resource);
|
||||
return;
|
||||
}
|
||||
throw new FHIRException("Unknown version " + version + " loading resource");
|
||||
|
@ -49,6 +49,14 @@ public class XmlParser extends XmlParserBase {
|
||||
setAllowUnknownContent(allowUnknownContent);
|
||||
}
|
||||
|
||||
public XmlParser(boolean allowUnknownContent, boolean pretty) {
|
||||
super();
|
||||
setAllowUnknownContent(allowUnknownContent);
|
||||
if (pretty) {
|
||||
setOutputStyle(OutputStyle.PRETTY);
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean parseElementContent(int eventType, XmlPullParser xpp, Element res)
|
||||
throws XmlPullParserException, IOException, FHIRFormatError {
|
||||
if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("extension"))
|
||||
|
Loading…
x
Reference in New Issue
Block a user