FHIR Chat · fhir-net-api pretty print xml serialization · implementers

Stream: implementers

Topic: fhir-net-api pretty print xml serialization


view this post on Zulip Sean McIlvenna (Jul 17 2017 at 21:00):

Is there a way using fhir-net-api to serialize to XML and have the results be pretty-printed (tabbed)?

view this post on Zulip Grahame Grieve (Jul 21 2017 at 10:43):

maybe you should ask on the dotnet stream

view this post on Zulip Richard Kavanagh (Jul 21 2017 at 22:51):

Hi @Sean McIlvenna

The way I do this is as follows:

First, serialise to XML via the API
1) String cc = FhirSerializer.SerializeToXml(_resource);

Then use LINQ to format it
2) var dd = System.Xml.Linq.XElement.Parse(cc).ToString();

That works for me

pasted image


Last updated: Apr 12 2022 at 19:14 UTC