기술 이야기2012. 8. 31. 09:58

 

            XmlWriterSettings settings = new XmlWriterSettings();

            settings.Async = true;

 

            StringBuilder sb = new StringBuilder();

            using (XmlWriter writer = XmlWriter.Create(sb, settings))

            {

                await writer.WriteStartElementAsync("pf", "root", "http://ns");

                await writer.WriteStartElementAsync(null, "sub", null);

                await writer.WriteAttributeStringAsync(null, "att", null, "val");

                await writer.WriteStringAsync("text");

                await writer.WriteEndElementAsync();

                await writer.WriteProcessingInstructionAsync("pName", "pValue");

                await writer.WriteCommentAsync("cValue");

                await writer.WriteCDataAsync("cdata value");

                await writer.WriteEndElementAsync();

                await writer.FlushAsync();

            }

 

          

             Framework4.5 에서 사용하는 XmlWriter 클래스에는 10가지 Create 메서드가 존재합니다.

             10가지 메서드 중에서 편하신걸로 만드시면 될듯합니다.

 

 

Posted by 페이퍼스터디