Page 1 of 1

How do you add XInclude to a Relax-NG Compact schema?

Posted: Tue Nov 18, 2008 11:36 pm
by Zearin
Two part question:
  1. Getting the schema.
    If there's an XInclude schema in existence, where is it? (Or, how would you write one in RNC? I'm sure it would be pretty easy, but I don't trust myself to write it with the highest possible degree of reusability…reusability is vital!)
  2. Using the schema.
    Once I include an XInclude schema in an RNC file, is there a flexible way to say “these are the elements that may be xincluded”, or would I just have to do element |= xi:include a bunch of times?

Re: How do you add XInclude to a Relax-NG Compact schema?

Posted: Wed Nov 19, 2008 12:26 pm
by sorin_ristache
Hello,

There is no special XInclude schema in RELAX NG. You have to define the xi:include element with attributes and subelements for example in a RELAX NG pattern called xi.include.def and add it to any element definition where xi:include is allowed, something like:

Code: Select all

divisions.def = part.def | reference.def | xi.include.def
Regards,
Sorin