I created XML Document and saved this document as
XmlDocument xmlDoc = new XmlDocument();
XmlDeclaration dec = xmlDoc.CreateXmlDeclaration("1.0", "UTF-8", null);
xmlDoc.AppendChild(dec);
XmlTextWriter writer = new XmlTextWriter(fullPath,Encoding.UTF8);
writer.Formatting = Formatting.Indented;
xMLDoc.Save(writer);
writer.Flush();
And then I have encoded this document using Base64 Encoder
The Decoder could not parse XML file. I created the decoder myself and got this result
?<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<ClinicalDocument
xmlns=\"urn:hl7-org:v3\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
classCode=\"DOCCLIN\" moodCode=\"EVN\" schemaLocation=\"urn:hl7-org:v3
CDA.xsd\">\r\n <typeId extension=\"POCD_HD000040\" root=\"2.16.840.1.113883.1.3
\" />\r\n
Please help me to resolve the issue. How I have to save the XML file to avoid the issues? Or How I have to encode to Base 64 to resolve the issue? I am using base64 encoder to encode xml file. I am requesting document. it is required to use base64 encoder. I decoded myself to check where is the problem. The decoder is Java . They can not parse the xml file I believe because ?< in front of the document.