xerces-j-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Greif" <jgr...@alumni.princeton.edu>
Subject Re: using XML schemas embedded in other files
Date Sat, 02 Nov 2002 01:45:40 GMT
Thanks, Neil.

I'm dealing with a particular case of embedded schemas, and have some
guidance from a) the WSDL spec, incomplete as it is, and b) the application

When I'm dealing with a piece of WSDL that specifies that the some operation
of the web services returns a thing of type T in namespace N, and I can find
the guaranteed unique definition of T in some schema with targetNamespace N
either a) embedded in the WSDL file, b) embedded in an imported WSDL file,
c) the root of an xsd file imported into one of the previous 2, I know
exactly how to interpret and use it.  As for the WSDL file itself, such
embedded schemas are explicitly supposed to be used to validate the WSDL
also (in combination with the schema for WSDL itself, etc).  In my usage,
there's no ambiguity about semantics.

There are some tricky bits, of course.  For example, there may be no
top-level element in the source schema with type T.  Thus, if I try to
extract the return value from the web service result, put it into a DOM
Document and try to validate against the schema, it will fail because it's
not one of the allowed top level elements of N or of the targetNamespace of
the WSDL file (it might always appear in some SOAP body), except in certain
cases.  Of course, I can build a schema on the fly which has that thing as a
top-level element and references the (N,T) type, to work around this

In the general case, I would tend to answer "yes" to your question about
whether the embedded schema should be used to validate the rest of the
document that comes from its targetNamespace, because types are supposed to
be unique within that namespace.  The one thing that gives me pause is that
you are allowed to specify parts of a targetNamespace in several schemas and
you're not required to specify a master schema to <xsd:include> all the
parts.  This problem subverts the schemaLocation mechanism in various ways.


----- Original Message -----
From: <neilg@ca.ibm.com>
To: <xerces-j-user@xml.apache.org>
Sent: Friday, November 01, 2002 12:12 PM
Subject: Re: using XML schemas embedded in other files

> Hi Jeff,
> The trouble with embedded schemas is that it's not at all clear what their
> semantics should be.  For instance, should it be the case that a parser
> should automatically start building a schema, whenever it sees an element
> named <schema> from the http://www.w3.org/2001/XMLSchema namesace?  Should
> there be a feature to control this behaviour?  Should the "embedded"
> be used to validate the rest of the document--or whatever portions of the
> document align with its targetNamespace?
> It's possible that  there might be some direction from the schema WG on
> that front; I'm curious what your preference would be?

To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org

View raw message