I know this is a vague open-ended question. I hope to get a general direction.
I need to add cXML punchout to an ASP.NET C # site / application. This replaces what I wrote many years ago in ColdFusion.
I am a fairly experienced C # developer, but I haven’t done much with XML. There seem to be many different options for processing XML in .NET.
Here's an open question: if I assume that I have an XML document in some form, such as a file or a string, what is the best way to read this in my code? I want to get data, and then query databases, etc. The size of the cXML document and our traffic volumes are small enough so that loading the cXML document into memory is not a problem.
Should I:
1) Manually create classes based on dtd and use XML Serializer?
2) Use the tool to create classes. There are examples of cXML files downloaded from Ariba.com. I tried xsd.exe to generate xsd and then xsd.exe / c to generate classes. When I try to deserialize, I get errors because there seems to be a “confusion” around whether some elements should be single values or arrays.
I tried the CodeXS online tool, but this gives errors in it log and errors if I try to deserialize a sample document.
2) Create a dataset and ReadXml ()?
3) Create a typed dataset and ReadXml ()?
4) Use Linq for XML. I often use Linq for Object, so I am familiar with Linq in general, but I am struggling to understand what it gives me in this situation.
5) Some other means.
, XML , ... ? ColdFusion ( "" ), XML "", -, . , , .
XML #. , Linq XML . "" .
...