I have an application which sends same XML document to many systems. Now one of the systems wants to get one field extra. The question is how can I add the field to the document and send it to all system without breaking their process. in a different wor, how can I make other systems to ignore the added field?
You can't do this without breaking existing recipients unless the recipients have been designed with this kind of change in mind.
It's very common for XML systems to specify a policy of "if you don't understand an element, then ignore it", and if you have such a policy, and people follow it, then adding new optional fields becomes easy. But if no such policy is in place, or if it hasn't been tested in anger, then adding fields risks breakage.
At the level of the schema, new fields can be added as optional elements or attributes. If the extensions are customisations for a particular client or group of clients, then you might want to consider putting the extra elements or attributes into a different namespace so they don't clash with extensions invented by someone else. This also allows you to exploit XSD schema wildcards which make any content valid provided it is in a different namespace.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With