|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: W3C XML Schema best practice : inclusions
Eric van der Vlist <vdv@d...> writes:
> The specific semantic of xsd:include appears then to be very low and one
> may wonder why a generic inclusion mechanism couldn't be used.
>
> The obvious advantage is that generic inclusion mechanism are readable
> by any supporting tool.
There's a widely-supported assertion in computer science that
text-substitution macros are dangerous mechanisms to use to bring
extensibility to a language. We chose to put <include> in the
language to allow us to control its semantics. One important
side-effect is that tools can depend on its effects in a way they
can't with text-inclusion mechanisms such as XInclude and general
entities.
> One should note that W3C XML Schema does also support XPointers within
> xsd:include or redefine [3]:
>
> "1.1 If the normalized value of the schemaLocation [attribute]
> successfully resolves, it resolves either
> 1.1.1 to (a fragment of) a resource of type text/xml, which in turn
> corresponds to a schema element information item in a well-formed
> information set, which in turn corresponds to a valid schema ..."
>
> My reading of this is that you can include, using xsd:include and a
> XPointer identifying a text/xml fragment, a single element definition
> such as:
>
> <xsd:element name="foo" type="ns1:bar"/>
Not so. The above quote says explicitly (you've lost the formatting
which makes this clear) that the identified resource must be a
<schema> EII. This is crucial -- otherwise how would we know, for
instance, whether an element was global or local in its schema?
Including or importing fragments would open up a whole complex design
issue for, in my opinion, very little gain.
ht
--
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@c...
URL: http://www.ltg.ed.ac.uk/~ht/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








