You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Benson Margulies <bi...@basistech.com> on 2007/10/31 01:30:58 UTC

XmlSchemaCollection

I think we have a problem with the use of XmlSchemaCollection.

This class seems intended to be used when reading schemas in from files,
and not when building them from scratch. There is no way to put anything
into it. When the ReflectionServiceFactoryBean creates one, it is always
simply a lonely container of the default schema types.

Aegis goes and serializes the schema to XML and then reads it back in to
add it to the collection! This allows it to use the collection to find
things. I can't see this winning prizes for speedy. Later,
ReflectionServiceFactoryBean.getOrCreateSchema adds more schemas, but it
doesn't do this process, so any schemas it adds in aren't added to the
collection. It doesn't look like JAXB adds any schemas, apparently
leaving this to RSFB.

While I'm not really happy creating a DOM of the schema just to pull it
back into the collection, it would probably solve my original problem of
missing cross-reference pointers even without the code I wrote to do
that just now. So I think I'll teach RSFB to do what Aegis does. It
would really be superior if XmlSchema would just give us a method to add
an XmlSchema to an XmlSchemaCollection without mapping out to DOM on the
way.