Thursday, November 15, 2012

Answers > How Exactly Does One Company Pass an Xml Document?

How Exactly Does One Company Pass an Xml Document?

by nForms on July 10, 2012

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.

Tags: , , , , , ,

Similar XForms | XML Posts

{ 2 comments… read them below or add one }

Ratchetr April 16, 2011 at 4:49 pm

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.

Erato April 16, 2011 at 4:49 pm

There’s several ways to do this but the most common is to provide a service for another org to request.
Query a database build out an array of your data points loop over that array printing out the appropriate xml tags. You can do this as any file type like .php just declare the in the doctype header that its an XML file.

If you want to make a true service you must also provide a WSDL this describes the XML file and tells the user what kinda of parameters they can send to your service like ?limit=50 would limit the returned nodes to 50 or what ever you want to program into your service.

Previous post:

Next post: