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

Discussion in 'XML' started by Le TeXnicien de Surface, Feb 20, 2008.

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

    --
    Le TeXnicien de Surface
     
    Le TeXnicien de Surface, Feb 20, 2008
    #1
    1. Advertising

  2. Le TeXnicien de Surface wrote:
    > 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
    >


    http://books.xmlschemata.org/relaxng/relax-CHP-10.html


    // Magnus
     
    Magnus Henriksson, Feb 20, 2008
    #2
    1. Advertising

  3. Magnus Henriksson écrivait/wrote :

    > Le TeXnicien de Surface wrote:
    >> 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
    >>

    >
    > http://books.xmlschemata.org/relaxng/relax-CHP-10.html


    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.

    --
    Le TeXnicien de Surface
     
    Le TeXnicien de Surface, Feb 20, 2008
    #3
  4. Le TeXnicien de Surface wrote:
    > Magnus Henriksson écrivait/wrote :
    >
    >> Le TeXnicien de Surface wrote:
    >>> 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
    >>>

    >> http://books.xmlschemata.org/relaxng/relax-CHP-10.html

    >
    > 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
     
    Magnus Henriksson, Feb 21, 2008
    #4
  5. Magnus Henriksson écrivait :
    > Le TeXnicien de Surface wrote:
    >> 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.


    > 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.
    --
    Le TeXnicien de Surface
     
    Le TeXnicien de Surface, Feb 22, 2008
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Markus
    Replies:
    1
    Views:
    1,557
    Markus
    Nov 23, 2005
  2. Robert Lintner
    Replies:
    3
    Views:
    4,104
    Susanne Oberhauser
    Jul 25, 2003
  3. test
    Replies:
    2
    Views:
    2,048
    Oliver Wong
    Jul 28, 2006
  4. markla
    Replies:
    1
    Views:
    552
    Steven Cheng
    Oct 6, 2008
  5. pramodr
    Replies:
    3
    Views:
    842
    Peter Flynn
    Apr 5, 2009
Loading...

Share This Page