Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » Removing components from an XML schema
Removing components from an XML schema [message #26345] Tue, 12 August 2003 14:39 Go to next message
Hayden Marchant is currently offline Hayden Marchant
Messages: 90
Registered: July 2009
Member
I am trying to prune an extremely large xsd by taking off unneeded
branches of it. The way I am doing this is to load the schema into memory,
and to remove the unwanted objects with the ECoreUtil.remove(EObject obj)
method. I am then writing the new compact schema back to a file.

In a small test case it works great. When I tried it with a real schema (a
set of XML schemas > 700KB), the remove method calls went extremely
slowly. It seems that every time remove is being called, the whole Schema
is being analyzed which is a lengthy process. I have about 2500 items I
need to remove, and each remove is taking about 1 second.

Is there anyway I can turn off the validation process when removing?

Thanks,
Hayden Marchant,
Unicorn Solutions Inc.
Re: Removing components from an XML schema [message #26383 is a reply to message #26345] Tue, 12 August 2003 15:09 Go to previous messageGo to next message
Eclipse User
Originally posted by: merks.ca.ibm.com

Hayden,

Yes, you can use XSDSchema.setIncrementalUpdate(false) to turn off the
expensive global updates and set it back to true, or call XSDSchema.update,
afterwards.


Hayden Marchant wrote:

> I am trying to prune an extremely large xsd by taking off unneeded
> branches of it. The way I am doing this is to load the schema into memory,
> and to remove the unwanted objects with the ECoreUtil.remove(EObject obj)
> method. I am then writing the new compact schema back to a file.
>
> In a small test case it works great. When I tried it with a real schema (a
> set of XML schemas > 700KB), the remove method calls went extremely
> slowly. It seems that every time remove is being called, the whole Schema
> is being analyzed which is a lengthy process. I have about 2500 items I
> need to remove, and each remove is taking about 1 second.
>
> Is there anyway I can turn off the validation process when removing?
>
> Thanks,
> Hayden Marchant,
> Unicorn Solutions Inc.
Re: Removing components from an XML schema [message #27820 is a reply to message #26383] Wed, 03 September 2003 14:36 Go to previous messageGo to next message
Shane Curcuru is currently offline Shane Curcuru
Messages: 30
Registered: July 2009
Member
This sounds like it should be a FAQ!

Presumably any large-scale schema modifications would go more quickly when
setIncrementalUpdate(false) is set. Is there a short and pithy warning
that you can attach to this state though? I imagine that while incremental
updates are off that the ECore magic that keeps all references running
right is not necessarily working. Can you shoot yourself in the foot by,
say, deleting an object from one side of a schema, and then trying to
access it through a reference from the other side of the schema?

Oh: does update() force setIncrementalUpdate(true) again, or do you still
need to do that yourself?

On Tue, 12 Aug 2003 11:09:56 -0400, Ed Merks <merks@ca.ibm.com> wrote:

> Hayden,
>
> Yes, you can use XSDSchema.setIncrementalUpdate(false) to turn off the
> expensive global updates and set it back to true, or call
> XSDSchema.update,
> afterwards.
--
Shane Curcuru
Re: Removing components from an XML schema [message #27940 is a reply to message #27820] Wed, 03 September 2003 16:40 Go to previous message
Eclipse User
Originally posted by: merks.ca.ibm.com

Shane,

The warning is that names will no longer be re-resolved and non-concrete
relations will no longer be recomputed. If you aren't relying on these to
drive your actions, it won't matter. I'm not sure how you'd actually be able
to injure yourself though...

Calling update is a one shot deal and doesn't affect whether incremental
updates will happen.


Shane Curcuru wrote:

> This sounds like it should be a FAQ!
>
> Presumably any large-scale schema modifications would go more quickly when
> setIncrementalUpdate(false) is set. Is there a short and pithy warning
> that you can attach to this state though? I imagine that while incremental
> updates are off that the ECore magic that keeps all references running
> right is not necessarily working. Can you shoot yourself in the foot by,
> say, deleting an object from one side of a schema, and then trying to
> access it through a reference from the other side of the schema?
>
> Oh: does update() force setIncrementalUpdate(true) again, or do you still
> need to do that yourself?
>
> On Tue, 12 Aug 2003 11:09:56 -0400, Ed Merks <merks@ca.ibm.com> wrote:
>
> > Hayden,
> >
> > Yes, you can use XSDSchema.setIncrementalUpdate(false) to turn off the
> > expensive global updates and set it back to true, or call
> > XSDSchema.update,
> > afterwards.
> --
> Shane Curcuru
Re: Removing components from an XML schema [message #575902 is a reply to message #26345] Tue, 12 August 2003 15:09 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26064
Registered: July 2009
Senior Member
Hayden,

Yes, you can use XSDSchema.setIncrementalUpdate(false) to turn off the
expensive global updates and set it back to true, or call XSDSchema.update,
afterwards.


Hayden Marchant wrote:

> I am trying to prune an extremely large xsd by taking off unneeded
> branches of it. The way I am doing this is to load the schema into memory,
> and to remove the unwanted objects with the ECoreUtil.remove(EObject obj)
> method. I am then writing the new compact schema back to a file.
>
> In a small test case it works great. When I tried it with a real schema (a
> set of XML schemas > 700KB), the remove method calls went extremely
> slowly. It seems that every time remove is being called, the whole Schema
> is being analyzed which is a lengthy process. I have about 2500 items I
> need to remove, and each remove is taking about 1 second.
>
> Is there anyway I can turn off the validation process when removing?
>
> Thanks,
> Hayden Marchant,
> Unicorn Solutions Inc.
Re: Removing components from an XML schema [message #576967 is a reply to message #26383] Wed, 03 September 2003 14:36 Go to previous message
Shane Curcuru is currently offline Shane Curcuru
Messages: 30
Registered: July 2009
Member
This sounds like it should be a FAQ!

Presumably any large-scale schema modifications would go more quickly when
setIncrementalUpdate(false) is set. Is there a short and pithy warning
that you can attach to this state though? I imagine that while incremental
updates are off that the ECore magic that keeps all references running
right is not necessarily working. Can you shoot yourself in the foot by,
say, deleting an object from one side of a schema, and then trying to
access it through a reference from the other side of the schema?

Oh: does update() force setIncrementalUpdate(true) again, or do you still
need to do that yourself?

On Tue, 12 Aug 2003 11:09:56 -0400, Ed Merks <merks@ca.ibm.com> wrote:

> Hayden,
>
> Yes, you can use XSDSchema.setIncrementalUpdate(false) to turn off the
> expensive global updates and set it back to true, or call
> XSDSchema.update,
> afterwards.
--
Shane Curcuru
Re: Removing components from an XML schema [message #577081 is a reply to message #27820] Wed, 03 September 2003 16:40 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26064
Registered: July 2009
Senior Member
Shane,

The warning is that names will no longer be re-resolved and non-concrete
relations will no longer be recomputed. If you aren't relying on these to
drive your actions, it won't matter. I'm not sure how you'd actually be able
to injure yourself though...

Calling update is a one shot deal and doesn't affect whether incremental
updates will happen.


Shane Curcuru wrote:

> This sounds like it should be a FAQ!
>
> Presumably any large-scale schema modifications would go more quickly when
> setIncrementalUpdate(false) is set. Is there a short and pithy warning
> that you can attach to this state though? I imagine that while incremental
> updates are off that the ECore magic that keeps all references running
> right is not necessarily working. Can you shoot yourself in the foot by,
> say, deleting an object from one side of a schema, and then trying to
> access it through a reference from the other side of the schema?
>
> Oh: does update() force setIncrementalUpdate(true) again, or do you still
> need to do that yourself?
>
> On Tue, 12 Aug 2003 11:09:56 -0400, Ed Merks <merks@ca.ibm.com> wrote:
>
> > Hayden,
> >
> > Yes, you can use XSDSchema.setIncrementalUpdate(false) to turn off the
> > expensive global updates and set it back to true, or call
> > XSDSchema.update,
> > afterwards.
> --
> Shane Curcuru
Previous Topic:Specific failure in XSDEcoreBuilder
Next Topic:Determining XSD/EMF versions programmatically
Goto Forum:
  


Current Time: Tue Sep 23 08:30:56 GMT 2014

Powered by FUDForum. Page generated in 0.02856 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software