Let’s say I have an XML something like this:
<root xmlns="default" xmlns:add="additional">
<element foo="fromDefault" />
<add:element foo="fromDefault" add:bar="fromAdditional" />
</root>
What I would like to do is to merge the two element definitions to avoid duplications, something like this:
<root xmlns="default" xmlns:add="additional">
<element foo="fromDefault" add:bar="fromAdditional" />
</root>
But I’m not even sure if this is possible.
I have the feeling it might be doable because we use some similar notations for the root elements like:
<root xmlns:xsi="..."
xsi:schemaLocation="...">
Unfortunately I wasn’t able to find any docs/references/tutorials/anything about this issue, could someone help me clarify if what I would like to do is possible (or not) and share some links with me?
Thanks in advance!
I think that you are looking for something like this:
additional.xsd
default.xsd
The first schema defines only the ‘additional’ stuff (in the example just an attribute) and the second schema imports it and defines everything else, referencing the additional stuff where needed.