You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Andy Putnins <pu...@lett.com> on 2009/02/21 18:33:37 UTC

SchemaTypeLoader.unloadXsd() method?

Is there some way to remove a schema from a SchemaTypeLoader?

The situation arises when I need to replace an already loaded schema
in a running system with a new version that may have added, deleted, 
and moved elements and attributes.

	- Andy


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


Re: SchemaTypeLoader.unloadXsd() method?

Posted by Radu Preotiuc <ra...@oracle.com>.
Actually, there isn't any way to replace an already loaded type (by
design, think Java classes). Once you have other types depending on it
and documents validated/typed accordingly, you can't really change the
type without things becoming inconsistent.

What you can do, is create another SchemaTypeLoader with the new
versions of the types and "union" it with the existing one:

XmlBeans.typeLoaderUnion(new SchemaTypeLoader[] {new_TL, existing_TL});

keeping in mind that typeLoaders earlier in the path take precedence.
Then, you load all your documents with this new TL and gradually phase
out the old one.

Radu

On Sat, 2009-02-21 at 12:33 -0500, Andy Putnins wrote:
> Is there some way to remove a schema from a SchemaTypeLoader?
> 
> The situation arises when I need to replace an already loaded schema
> in a running system with a new version that may have added, deleted,
> and moved elements and attributes.
> 
> 	- Andy
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
> 


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