[rnc schema] how to refer to a file (equivalent of (dtd) ENTITY)

  • Thread starter Le TeXnicien de Surface
  • Start date
L

Le TeXnicien de Surface

hello all

I'd like to use a schema written in relaxng compact syntax and
``include'' external files in a master-file with something
akin to the use of &file01; and the declaration of an ENTITY in a dtd.

Any hint would be greatly appreciated.

Many thanks in advance
 
L

Le TeXnicien de Surface

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.
 
M

Magnus Henriksson

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
 
L

Le TeXnicien de Surface

Magnus Henriksson écrivait :
Your problem (if I have understood correctly) is that you want to
include content from one XML document into another.
It is! It seems I've been clearer this time :)
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.
This is good news, I already did that so I should be able to do it again :)
2) Use XInclude (http://www.w3.org/TR/xinclude/). Decide whether you
want to validate before or after transclusion.
I'll have a look to enlarge my knowledge.
3) Device your own mechanism, from scratch or as a variation on XInclude.
That I think I won't even try :)

Many thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top