Skip to main content



      Home
Home » Archived » XML Schema Definition (XSD) » Problems copying an XSDSchema
Problems copying an XSDSchema [message #42314] Tue, 27 April 2004 18:13 Go to next message
Eclipse UserFriend
For the purpose of performing a "save as" type operation on an XSDResource I
create a new resource instance and then attempt to copy the root EObjects
and then add the copies to the new resource's contents. When executing the
copy on a XSDResource composed of XSDSimpleTypeDefinition instances I
encounter an IllegalArgumentException. It appears that the
XSDSimpleTypeDefinition.patch code is attempting to set a member type
definition that already exists in the list. My question is should I be able
to copy a XSDSchema instance and paste it into a new XSDResource ? Are
there special considerations that need to be taken into account when copying
an XSDSchema instance?

Thread [main] (Suspended (exception IllegalArgumentException))
EObjectEList(BasicEList).set(int, Object) line: 543
BasicEList$EListIterator.set(Object) line: 1398
XSDSimpleTypeDefinitionImpl.patch() line: 680
XSDSchemaImpl(XSDConcreteComponentImpl).patch() line: 513
XSDSchemaImpl.patch() line: 1494
XSDSchemaImpl.traverseToRootForPatching() line: 1468
XSDSchemaImpl.adoptContent(EReference, XSDConcreteComponent) line: 1767
XSDSchemaImpl(XSDConcreteComponentImpl).eNotify(Notification ) line: 1133
NotificationChainImpl.dispatch(Notification) line: 115
NotificationChainImpl.dispatch() line: 103
EObjectContainmentEList(NotifyingListImpl).addAllUnique(int, Collection)
line: 342
EObjectContainmentEList(NotifyingListImpl).addAllUnique(Coll ection) line:
294
EObjectContainmentEList(BasicEList).addAll(Collection) line: 675
EcoreUtil$Copier.copyContainment(EReference, EObject, EObject) line: 387
EcoreUtil$Copier.copy(EObject) line: 365
EcoreUtil$Copier.copyAll(Collection) line: 336
EcoreUtil.copyAll(Collection) line: 300

Thanks in advance,

Dennis Fuglsang
Re: Problems copying an XSDSchema [message #42345 is a reply to message #42314] Tue, 27 April 2004 18:34 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Dennis,

The XSD model doesn't have all the right features set to be derived to avoid
generically copying things that should not be copied because they are computed.
Use cloneConcreteComponent if you need to do a copy. But you probably want to
copy the DOM itself anyway. And why not use Resource.save with an output stream
for where you want to save?

Dennis Fuglsang wrote:

> For the purpose of performing a "save as" type operation on an XSDResource I
> create a new resource instance and then attempt to copy the root EObjects
> and then add the copies to the new resource's contents. When executing the
> copy on a XSDResource composed of XSDSimpleTypeDefinition instances I
> encounter an IllegalArgumentException. It appears that the
> XSDSimpleTypeDefinition.patch code is attempting to set a member type
> definition that already exists in the list. My question is should I be able
> to copy a XSDSchema instance and paste it into a new XSDResource ? Are
> there special considerations that need to be taken into account when copying
> an XSDSchema instance?
>
> Thread [main] (Suspended (exception IllegalArgumentException))
> EObjectEList(BasicEList).set(int, Object) line: 543
> BasicEList$EListIterator.set(Object) line: 1398
> XSDSimpleTypeDefinitionImpl.patch() line: 680
> XSDSchemaImpl(XSDConcreteComponentImpl).patch() line: 513
> XSDSchemaImpl.patch() line: 1494
> XSDSchemaImpl.traverseToRootForPatching() line: 1468
> XSDSchemaImpl.adoptContent(EReference, XSDConcreteComponent) line: 1767
> XSDSchemaImpl(XSDConcreteComponentImpl).eNotify(Notification ) line: 1133
> NotificationChainImpl.dispatch(Notification) line: 115
> NotificationChainImpl.dispatch() line: 103
> EObjectContainmentEList(NotifyingListImpl).addAllUnique(int, Collection)
> line: 342
> EObjectContainmentEList(NotifyingListImpl).addAllUnique(Coll ection) line:
> 294
> EObjectContainmentEList(BasicEList).addAll(Collection) line: 675
> EcoreUtil$Copier.copyContainment(EReference, EObject, EObject) line: 387
> EcoreUtil$Copier.copy(EObject) line: 365
> EcoreUtil$Copier.copyAll(Collection) line: 336
> EcoreUtil.copyAll(Collection) line: 300
>
> Thanks in advance,
>
> Dennis Fuglsang
Re: Problems copying an XSDSchema [message #586101 is a reply to message #42314] Tue, 27 April 2004 18:34 Go to previous message
Eclipse UserFriend
Dennis,

The XSD model doesn't have all the right features set to be derived to avoid
generically copying things that should not be copied because they are computed.
Use cloneConcreteComponent if you need to do a copy. But you probably want to
copy the DOM itself anyway. And why not use Resource.save with an output stream
for where you want to save?

Dennis Fuglsang wrote:

> For the purpose of performing a "save as" type operation on an XSDResource I
> create a new resource instance and then attempt to copy the root EObjects
> and then add the copies to the new resource's contents. When executing the
> copy on a XSDResource composed of XSDSimpleTypeDefinition instances I
> encounter an IllegalArgumentException. It appears that the
> XSDSimpleTypeDefinition.patch code is attempting to set a member type
> definition that already exists in the list. My question is should I be able
> to copy a XSDSchema instance and paste it into a new XSDResource ? Are
> there special considerations that need to be taken into account when copying
> an XSDSchema instance?
>
> Thread [main] (Suspended (exception IllegalArgumentException))
> EObjectEList(BasicEList).set(int, Object) line: 543
> BasicEList$EListIterator.set(Object) line: 1398
> XSDSimpleTypeDefinitionImpl.patch() line: 680
> XSDSchemaImpl(XSDConcreteComponentImpl).patch() line: 513
> XSDSchemaImpl.patch() line: 1494
> XSDSchemaImpl.traverseToRootForPatching() line: 1468
> XSDSchemaImpl.adoptContent(EReference, XSDConcreteComponent) line: 1767
> XSDSchemaImpl(XSDConcreteComponentImpl).eNotify(Notification ) line: 1133
> NotificationChainImpl.dispatch(Notification) line: 115
> NotificationChainImpl.dispatch() line: 103
> EObjectContainmentEList(NotifyingListImpl).addAllUnique(int, Collection)
> line: 342
> EObjectContainmentEList(NotifyingListImpl).addAllUnique(Coll ection) line:
> 294
> EObjectContainmentEList(BasicEList).addAll(Collection) line: 675
> EcoreUtil$Copier.copyContainment(EReference, EObject, EObject) line: 387
> EcoreUtil$Copier.copy(EObject) line: 365
> EcoreUtil$Copier.copyAll(Collection) line: 336
> EcoreUtil.copyAll(Collection) line: 300
>
> Thanks in advance,
>
> Dennis Fuglsang
Previous Topic:Problems copying an XSDSchema
Next Topic:Annotation appinfo troubles
Goto Forum:
  


Current Time: Thu Jul 24 17:18:40 EDT 2025

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

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

Back to the top