Validating xml against dtd
On the other hand if you have an informal relationship with then you can be generous with what you will accept / reject. It ensures a higher level of correctness at the expense of more upfront labor.
another business) then having XML schemas allows you to establish a contract about what you will accept as input and give as output. Validating XML against a schema (DTD is outdated garbage) is equivalent to using a statically typed language.It doesn't even have to be a good transformer, It's easier to change the method of transforming data to xml than changing custom validators.Here's an example for transforming above to The strict validators will reject the model if it contains any attributes/elements that aren't declared in the DTD, which is useful for when your programs are fragile to key,value pairs that it doesn't expect.The closer you keep to definitions and validations the less likely you run in unexpected trouble when things change. For example if you wish to pick out one or two pieces of data out the XML then move on then it would be best just to extract them and move on.However if you need the whole XML document, so for example you want to transform it to some other XML format that needs all the fields, then I would get a schema involved.