You must Sign In to post a response.
- Category: XML
- #763370Are you using "XmlWriter"
If you are using "XmlWriter". you can use function
"WriteDocType" in the "XmlWriter" object.
Direction is important than speed
- #763375Hello Manisha,
If you have problem with the code while inserting DOCTYPE element in XmlDocument then it will be better to share your code with us to help you in better way.
If you don't know how to add DOCTYPE Element in XmlDocument then refer the below sample code :
XmlSerializerNamespaces ns = new XmlSerializerNamespaces();
var stringwriter = new System.IO.StringWriter();
using (XmlWriter writer = XmlWriter.Create(stringwriter))
writer.WriteDocType("service or class name", "string value", "string value", null);
var serializer = new XmlSerializer(typeof(myService)); // type of can be anything like class, service, dataset, etc.
serializer.Serialize(writer, obj, ns); // obj can be anything like object of class or service
var str = stringwriter.ToString();
Hope this will be helpful for you.
DNS Gold Member
"Failure is the path of least persistence"
- #763411thank you so much .. :)