We have XSD file we give our clients for XML validation. This is a common XSD file for different XMLs from different teams. I am trying to find out if there are better ways for XML validation other than using XSD. It is difficult to maintain as we have multiple teams using the same XSD and one team making changes to the XSD shouldn't affect the other teams
-
Rollback reason: It is unacceptable to change questions in ways that invalidate or substantially impact existing answers. Both answers had already addressed the expressed concern that *It is difficult to maintain as we have multiple teams using the same XSD and one team making changes to the XSD shouldn't affect the other teams*, so removing that concern should not be done after answers have addressed it. – kjhughes Nov 21 '20 at 07:13
2 Answers
Other XML Validation Options
There are, of course, XML validation standards other than XSD: DTD, RelaxNG, Schematron...
Real Problem
However, seeking a technical solution to an imprecisely described organization problem is misguided. An XML schema (of any sort) is a tool for describing and communicating XML vocabularies and grammars. To expect that
one team making changes to the XSD shouldn't affect the other teams
is to deny a fundamental reason for creating an XML schema: communication of agreement over XML vocabulary and grammar design.
First define your organizational control problem. Then ask how technical solutions might support your targeted structure. Conflating the two is no way to approach the challenge.
See Also

- 106,133
- 27
- 181
- 240
You could use DTD or Relax NG schema, but I don't think switching to either of those is going to solve your issue.
Not sure how the teams come into play, but any change to the XSD Schema (or DTD, Relax NG schema, etc.) should impact any other XML that also uses that schema for validation. If there is an XML file that should not be impacted, maybe it needs to be validated by a different schema.
You can modularize your schemas so you don't have to duplicate pieces of the schema that are the same.
Also, you might want to consider tighter control on who modifies the schema and when. Maybe have something like a change review board that discusses potential changes and the impacts to other teams, document types, and consumers of the data.

- 51,389
- 6
- 69
- 95
-
Right, OP's assumption that changing technologies will solve his organization/social problems is fundamentally misguided. – kjhughes Dec 01 '17 at 21:28
-
@kjhughes - It'd be nice though! ;-) +1 for your excellent answer as well. Can't believe I left out schematron :-/ – Daniel Haley Dec 01 '17 at 21:30