Le said:
Magnus Henriksson écrivait/wrote :
Many thanks for this adress. I didn't know such a book existed on the web,
it will certainly be useful in the days to come.
Nevertheless try as I may I can't find in it an answer to my question. I see
plenty of things about including a schema in a schema but I fail to
understand how I could achieve something like that (I hope it will be
clearer)
I've got a file f01.xml which is declared in a DTD with something like
<!ENTITY file01 SYSTEM ./bits/file01.xml>
and inside a master.xml file I write
<thing>&file01;</thing>
Any further help would be greatly appreciated.
Ah, I misunderstood. I thought you wanted to create a RELAX NG schema
from parts of other schemas.
Your problem (if I have understood correctly) is that you want to
include content from one XML document into another.
You basically have three options:
1) Declare file01.xml as an external parsed entity in the internal DTD
subset of master.xml (
http://www.w3.org/TR/REC-xml/#sec-external-ent)
and then refer to that entity somewhere in the document
(
http://www.w3.org/TR/REC-xml/#NT-EntityRef). This mechanism can be used
regardless of schema languages.
2) Use XInclude (
http://www.w3.org/TR/xinclude/). Decide whether you
want to validate before or after transclusion.
3) Device your own mechanism, from scratch or as a variation on XInclude.
// Magnus