asp.net - Creating XML using C# and an external DTD -


This is my first step with XML and I have to send the XML through HTTPEnd (which is no longer a problem for me). I have a question about DTDs According to the HttpRequest destination API, I have to use my XML as an external DTD which is located there (this is for Canada Post shipping). I know that to write / read XML, but according to DTD ... is there any difference?

Can anyone tell me that this is the easiest way? I've seen a good part of a good post from Google and never wanted to ...

Thank you!

ADD # 1

Note: I know what is for DTD, and I can create one with a plain text editor and DTD But I mean, one way to take advantage of this is to use DTD's C # (make an object or some time ...)

ADD # 2 Add-ons: None of you are already using the Canada Post API WebSearch? because I am hungry! I send my request with my data and it never ends, so there is never a response ... here is my code:

  Public OSIPping Response Retrieving Code (OSIPPing Information Ship Efos) {// Submit WebRequest Request = Create WebRCC ("http://sellonline.canadapost.ca"); XmlDocument xmlDoc = shipInfos.WriteAsXML (); Request.ContentType = "text / xml"; request. Method = "post"; XmlDoc.Save (request.GetRequestStream ()); Try {WebResponse response = request.GetResponse (); } Hold (Exceptional) {East; } Return new OShipping Response (); }  

No, how there is no difference between you Write your XML, apart from this, you must follow the rules given in the DTD. Understanding and reading DTD is an art, so I hope that Canada Post is a more descriptive way of understanding the format to help you create the right XML.

After that, whether Canada Post requests, you should validate the XML against your DDD. If valid, this does not mean that the input is correct, you should warn about invalid input soon. And that's exactly why you want to do this: If your output is guaranteed against DTD, then you can guarantee that they can process the input (at least in most cases).

.

Note to edit XML with hand: Most XML editors are able to read a DTD and warn you that the DTD is correct, or you also give the syntax when you type, i.e. the visual studio In. The XML standard demands that if the DTD is present in the header of XML, then XML will be valid and should not be processed if it is not valid against DTS .


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -