Hello,
how can I transparently insert one XML file into another? I am looking
for a method simmilar to the #include <file> known from the C language.
To be more precise, an example:
I have one file:
MainDocument.xml
<Document>
<Person>
<Name>Mr X</Name>
<Biography>His life was very long and boring.</Biography>
</Person>
<Person>
<Name>Mr Y</Name>
<Biography>His life was very long too.</Biography>
</Person>
</Document>
And need to have three files, something like this:
MainDocument.xml
<Document>
<Person>
<Name>Mr X</Name>
<Include filename="MrX.xml"/> <!--That is the question-->
</Person>
<Person>
<Name>Mr Y</Name>
<Include filename="MrY.xml"/> <!--That is the question-->
</Person>
</Document>
MrX.xml
<Biography>His life was very long and boring.</Biography>
MrY.xml
<Biography>His life was very long too.</Biography>
The desired construction/method should just replace the link (eg.
<Include> element) with the content of the proper file. And the most
important is to make the parser/validator recognizes the
MainDocument.xml file as valid in both variants, using one schema for
them; in other words: including or linking should be transparent for the
parser (assumming, that all included files are accessible).
I suppose that my question is very basic, I've tried to find an answer
with Google (XML link, include, insert, embed etc.) but failed. Could
you give me a hint?
Thanks,
Wojtek