How exactly does one company pass an xml document?
For example,
Company X is requesting an doc in XML format from Company Y.
Does Company Y just send the doc, or does it have to send a DTD or XML schema along with the doc?
I understand XML and XML schemas, but I’ve never been in a situation where I’ve had to pass an XML doc to somebody else, so I’m curious about the process.
There doesn’t seem to be a hard and fast answer rule here. I’ve been through this a couple times, both as company X and Y., and I’ve seen (and used) a couple different solutions. DTD’s are a bit dated, I think. I vaguely remember getting one a few years back. My preference is the schema.
Remember that the DTD or schema only defines the syntax of the XML document, not the semantics. The schema might tell you that there’s a field called ResidualQuota that’s a double and occurs exactly once. But what does ResidualQuota mean? Well, it means nothing here, I just made it up. But if you’re adding it to your XML, it probably has an obvious meaning to you. EVERYONE knows what a ResidualQuota means, right? Maybe everyone in company X, but maybe not at Company Y. And even if they do know what it means, they might not be sure if the value is dollars or cents or fahrenheit or centigrade. Or maybe it’s in megaflops?
So you usually need a document that defines the semantics of the XML. That document might just include the schema in an appendix.
Either company X writes the document: This is what we’re giving you. Or company Y writes it: This is what we demand you give us.