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

This should cover W3C XML Schema, Relax NG and DTD related problems.
Zearin
Posts: 107
Joined: Mon Jul 30, 2007 11:31 pm
Location: College Park, MD, United States

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

Post 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?
-- Zearin
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

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

Post 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
Post Reply