我创建了XML Document并将此文档保存为
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();
Run Code Online (Sandbox Code Playgroud)
然后我使用Base64 Encoder编码了这个文档
解码器无法解析XML文件.我自己创建了解码器并得到了这个结果
?<?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
Run Code Online (Sandbox Code Playgroud)
请帮我解决这个问题.我如何保存XML文件以避免问题?或者我如何编码到Base 64来解决问题?我使用base64编码器来编码xml文件.我要求提供文件.它需要使用base64编码器.我解码自己检查问题在哪里.解码器是Java.他们无法解析我认为的xml文件,因为?<在文档前面.