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 2002/10/29 23:27:09 UTC

using XML schemas embedded in other files

WSDL files may contain XML Schemas, or may import .xsd or other .wsdl files
that may contain schemas.  I would like to be able to refer the locations of
these schemas using some kind of URI + fragment notation in the spirit of
XPointer, and integrate this usage with Xerces 2.

For example, I would like to return the result of a web service invocation
to a client program, telling it the QName of the type of the result, and
specifying the location of the schema defining that type.  Among the
possibilities I can think of to do this are:
  1.  Extend the external schemaLocation mechanism and/or the schemaLoader
class to handle URI#xpath("/some-path/xsd:schema") types of locations.  I
think this would require producing variants of several implementation
classes, which seems of dubious merit, particularly given the frequency of
Xerces releases.
  2.  Handle the fragment identifiers myself: retrieve the URI, parse it,
use XPath (from xalan, say) on the the DOM, serialize the extracted schema
and reparse it into a caching grammar pool.  This is pretty straightforward,
and there is probably some way I can optimize away the second parse.  Will
the grammar pool will be used even if the schemaLocation is not on the
external schemaLocations list?  Can some cached grammars  in a pool be
marked as permanent, while the others can be flushed to make room for new
ones?  Or is there a way to use two grammar pools, one for the permanent
grammars and the other for the transient (but potentially cached) ones?
  3.  Make a local filesystem copy (if not found in a standard location) of
the schema extracted from the wsdl and put it on the schemaLocation list.
This is fragile in the face of version upgrades of the WSDL file.

Has anyone a better idea, or advice about any of these approaches?

Jeff Greif
Webalo, Inc.


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