You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Jeff Greif <jg...@alumni.princeton.edu> on 2005/04/16 16:17:48 UTC
'universe' for element substitutions in XML Schema
This question might alternately be phrased as 'What determines the set
of schemas available for a validation episode?'
Suppose a parser is instantiated with a grammar pool and used to
preparse the grammar for namespace C, which imports B, which imports A.
There is an abstract element a in A which declares itself the head of a
substitution group, an element b in B which affiliates with that group
declares itself the head of a substitution group, an element c of C
which affiliates with b's substituion group and an element c' of C which
affiliates itself with a.
This parser is used to validate a document d1 with a root element in
namespace B. Somewhere in the content there is a reference to element
a. When the allowed substitutions are determined for a, are b, c and c'
in the set, or just b, or some other combination?
Now the grammar for namespace E, also importing B, is preparsed using
the same grammar pool. There is an element e in E which affiliates
itself with b's substitution group. If I reparse d1, will e now appear
in the valid substitutions for a? Is there a dependence on the history
of a parser's grammar pool?
Would the answer to these questions be different if the root element of
d1 were in namespace C? Would the contents of the parser's
externalSchemaLocations property make any difference to the answers?
Does the XML Schema spec specify what namespaces are involved in a
particular validation episode? If so, a pointer to the relevant section
(which I've obviously missed) would be helpful. If not, is this a
matter left up to the implementation?
[One situation in which this might matter is in reading WSDL
descriptions of web services. The WSDL description contains or imports
schemas which describe the types for the inputs and outputs of several
web services. This might be grammar C in the example above. Some of
those inputs or outputs may be defined in B. Another WSDL description
for some other web services might import grammar E. If a form were
being generated for the input to an operation that allowed for all the
possible substitutions of certain elements, would that form be different
depending upon the usage history of the parser or grammar pool?]
Jeff
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org
Re: 'universe' for element substitutions in XML Schema
Posted by gareth <ga...@parthcomp.com>.
Hi,
The caching feature is an optimization. As such, it should have no real
impact on how things are validated. Try your examples with caching
turned off. If there is a difference after caching is turned on then
mail us.
Jeff Greif wrote:
> This question might alternately be phrased as 'What determines the set
> of schemas available for a validation episode?'
The schema that your instance document refers to explicitly or
implicitly (via namespace) defines the top level schema. That schema may
include and import other schemas and if it does then they will be in the
set of schemas.
>
> This parser is used to validate a document d1 with a root element in
> namespace B. Somewhere in the content there is a reference to element
> a. When the allowed substitutions are determined for a, are b, c and c'
> in the set, or just b, or some other combination?
The point to focus on here is that the document d1 is associated with
the schema that defines namespace B. Any includes or imports will be
resolved and that will be the set of things that are used.
> Does the XML Schema spec specify what namespaces are involved in a
> particular validation episode? If so, a pointer to the relevant section
> (which I've obviously missed) would be helpful. If not, is this a
> matter left up to the implementation?
There is a section on importing that may be helpful:
http://www.w3.org/TR/xmlschema-1/#composition-schemaImport
Gareth
--
Gareth Reakes, Managing Director Parthenon Computing
+44-1865-811184 http://blog.parthcomp.com/xerces
---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org