I have the following problem: I have 2 XML documents, both generated by different source systems and while both will, for example, have elements ABC, they also will have unremovable elements generated by the source system.
My question is: can I use a single schema to validate two slightly different XML files?
For example:
Doc1:
<gibberish/>
<system_specific_nonsense/>
<A>
<uselessblock>
<B>
<ID/>
<name/>
</B>
</uselessblock>
</A>
Doc2
<stuff/>
<gobbletygook/>
<lalalalalalalal/>
<A>
<B>
<ID/>
<name/>
</B>
</A>
Is there a way to have a schema that only vaguely says:
<A>
<B>
<ID/>
<name/>
</B>
</A>
In other words, a schema that ignores hierarchy depth and unrecognized elements, only vaguely saying "It must have an A, and somewhere in that A is a B, and somewhere in that B is an ID and a name".
Is this even remotely possible? If not, are there any workarounds I might look into?
Background info: I'm taking nightly data from a source system and a slave system. I compare the source to the slave to see what is different between the two and then pushing the change-only data to the slave system. In order to facilitate this, I want any data extracted from either system run through the vague validation because my comparison code is vague enough to ignore hierarchy depth.
Thanks.