Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » Copying/Cloning Annotations
Copying/Cloning Annotations [message #597133] Tue, 08 November 2005 15:06
David Carver is currently offline David CarverFriend
Messages: 174
Registered: July 2009
Senior Member
When I'm serliazing the new schema, none of the annotations that I'm
setting are showing up. I realize when you clone ConcreteComponent that
the new component will not contain any of the annotations and you have to
create those. However, the following code adds the annotations to the
cloned node, but for some reason they aren't serialized. Here is the
corresponding code:

XSDComplexTypeDefinition clonedType =
(XSDComplexTypeDefinition)component.cloneConcreteComponent(t rue, false);
XSDComplexTypeDefinition type = (XSDComplexTypeDefinition) component;
XSDAnnotation annotation = type.getAnnotation();
if (annotation != null) {
XSDAnnotation clonedAnno = XSDFactory.eINSTANCE.createXSDAnnotation();
for (Iterator it = annotation.getUserInformation().iterator();
it.hasNext();) {
Element docuElements = (Element);
Element docCloned = (Element)docuElements.cloneNode(true);

This looks like it should work, any idea why the annotations aren't
serialized with the rest of the schema.
Previous Topic:Copy Schema item
Next Topic:Copying/Cloning Annotations
Goto Forum:

Current Time: Sat Jan 23 02:50:57 GMT 2021

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

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

Back to the top