Re: [Moderator Action] Including more than one schema

Rubén Ortiz <ruben.ortiz@newknow.com> writes:

> I have an old problem of the C language and its includes but with schemas.
> 
> I have defined a schema A.xsd, a schema B.xsd that includes A.xsd, a schema
> C.xsd that includes A.xsd, and a schema D.xsd that includes B and C.
> 
> My XML Schema validator says that elements in A.xsd are already defined. 
> 
> How can I define something as:?
> 
> #ifndef A 
>     #include A
> #endif

You can't, but your schema validator should be trying harder.  Section 
6.2.1 [1] explains the processors should not complain about multiple
includes of the same components, and may avoid multiple including of
the same document altogether:

  "NOTE: The above is carefully worded so that multiple includeing of
  the same schema document will not constitute a violation of clause 2
  of Schema Properties Correct (5.13), but applications are allowed,
  indeed encouraged, to avoid includeing the same schema document more
  than once to forestall the necessity of establishing identity
  component by component."

ht

[1] http://www.w3.org/TR/xmlschema-1/#compound-schema
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/

Received on Thursday, 1 February 2001 16:19:28 UTC